Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops. #12520

Closed
wants to merge 1 commit into from

Conversation

sergachev
Copy link
Contributor

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.

@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label May 15, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label May 15, 2024
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 16, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
f47f18016777468fe274bea00945d5209a2cdb57 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag f47f18016777468fe274bea00945d5209a2cdb57
PiperOrigin-RevId: 634336994
@dimitar-asenov
Copy link
Member

This breaks one of TensorFlow's deterministic ops tests. I'm looking into it.

@dimitar-asenov
Copy link
Member

@sergachev Could you please rebase this PR, as it has conflicting changes at the moment.

@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label May 16, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label May 16, 2024
@sergachev
Copy link
Contributor Author

Done

Copy link
Member

@akuegel akuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the rebase

copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
4e2837457dc426154bf80f321c001c916a7d3677 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag 4e2837457dc426154bf80f321c001c916a7d3677
PiperOrigin-RevId: 634336994
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
4e2837457dc426154bf80f321c001c916a7d3677 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag 4e2837457dc426154bf80f321c001c916a7d3677
PiperOrigin-RevId: 634336994
@dimitar-asenov
Copy link
Member

dimitar-asenov commented May 17, 2024

This change fails this OSS test (running on Linux): https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/kernel_tests/nn_ops/cudnn_deterministic_ops_test.py

The failure is miscomparison in numerics, I guess something in the way the determinism is being controlled doesn't work out.

Interestingly, running the same test in our internal build environment passes. I'll have a look at this, but if you have any ideas in the meantime, please let me know.

@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label May 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label May 17, 2024
@sergachev
Copy link
Contributor Author

Maybe I know what the problem is - after reading it again I think this line

config.debug_options().xla_gpu_deterministic_ops();
should stay unchanged (it's expected that RequireDeterminism() here disables autotuning).

@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label May 17, 2024
@sergachev
Copy link
Contributor Author

Removed that change and updated the comments.

@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label May 17, 2024
copybara-service bot pushed a commit that referenced this pull request May 17, 2024
Imported from GitHub PR #12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
4e28374 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12520 from openxla:new_determinism_flag 4e28374
PiperOrigin-RevId: 634721436
@dimitar-asenov
Copy link
Member

Thanks. I'm not sure if that was the issue. In any case there is another which I'm fixing internally:

  • Simply using the special setter setter_for_xla_gpu_deterministic_ops to set the new flag whenever --xla_gpu_deterministic_ops is also set, doesn't work. The reason is that it's possible to manually construct debug options without calling into this logic at all. So the correct implementation is to change to code everywhere where needed to check both flags.

copybara-service bot pushed a commit that referenced this pull request May 17, 2024
Imported from GitHub PR #12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
4e28374 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12520 from openxla:new_determinism_flag 4e28374
PiperOrigin-RevId: 634721436
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
68b555ff66f299423a8de6aef595cf38f621976f by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag 68b555ff66f299423a8de6aef595cf38f621976f
PiperOrigin-RevId: 634336994
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
4e2837457dc426154bf80f321c001c916a7d3677 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag 4e2837457dc426154bf80f321c001c916a7d3677
PiperOrigin-RevId: 634721436
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
68b555ff66f299423a8de6aef595cf38f621976f by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag 68b555ff66f299423a8de6aef595cf38f621976f
PiperOrigin-RevId: 634336994
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
68b555ff66f299423a8de6aef595cf38f621976f by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#12520 from openxla:new_determinism_flag 68b555ff66f299423a8de6aef595cf38f621976f
PiperOrigin-RevId: 634336994
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request May 17, 2024
Imported from GitHub PR openxla/xla#12520

It's more granular than the existing --xla_gpu_deterministic_ops because it allows doing an autotuning compilation with non-deterministic ops disabled.

--xla_gpu_deterministic_ops is a superset of --xla_gpu_exclude_nondeterministic_ops, so --xla_gpu_deterministic_ops=true will be setting --xla_gpu_exclude_nondeterministic_ops=true too.
Copybara import of the project:

--
4e2837457dc426154bf80f321c001c916a7d3677 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Add new flag xla_gpu_exclude_nondeterministic_ops.

Merging this change closes #12520

PiperOrigin-RevId: 634756524
@sergachev sergachev deleted the new_determinism_flag branch May 23, 2024 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants