Add getHint helper to CommOptions#994
Open
pavanbalaji wants to merge 6 commits intometa-pytorch:mainfrom
Open
Conversation
Contributor
|
@pavanbalaji has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95748622. |
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Differential Revision: D95748622
ca3591f to
ffbe6a5
Compare
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Differential Revision: D95748622
7a84b5d to
40e2462
Compare
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 10, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Reviewed By: kapilsh Differential Revision: D95748622
40e2462 to
bcfdc36
Compare
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 10, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Reviewed By: kapilsh Differential Revision: D95748622
bcfdc36 to
12aec12
Compare
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 10, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Reviewed By: kapilsh Differential Revision: D95748622
12aec12 to
4142414
Compare
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 10, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Reviewed By: kapilsh Differential Revision: D95748622
4142414 to
95f481c
Compare
Summary: Move StoreManager.hpp/cpp from the top-level directory to utils/ to reflect its internal utility status. Update all include paths across backend bootstrap files and BUCK. Remove unused includes from utils/Utils.cpp. Differential Revision: D94889993
Summary: Move the internal logging utility header from the top-level torchcomms directory into utils/ alongside other utility files (Utils.hpp, StoreManager.hpp), and rename it to Logging.hpp for consistency with the project's naming conventions. Update all source files that include the header to use the new path, preserving the existing include style (double-quote, angle-bracket, and manual tag variants). Also remove unused caffe2:torch-cpp-cpu dep from tests/integration/cpp/BUCK (linter fix). Differential Revision: D94889992
Summary: Move TorchCommTracingGuard from TorchCommTracing.hpp/.cpp to utils/TracingGuard.hpp/.cpp and rename the class to TracingGuard. This matches the existing utils pattern (utils/Logging.hpp, utils/Utils.hpp, utils/StoreManager.hpp) and reflects that the class is an internal utility, not a public API. Updated include paths and class references across all backends (nccl, ncclx, rccl, rcclx, xccl, gloo, hccl, mccl). The BUCK target name torchcomms-tracing-cpp is unchanged so downstream deps are unaffected. Differential Revision: D95017391
Summary: A CommOptions always goes to exactly one backend, so the torchcomm::<backend>:: prefix on hint keys is unnecessary and overly verbose. This change simplifies all hint keys to bare names (e.g., "high_priority_stream" instead of "torchcomm::nccl::high_priority_stream"). The prefix-based filtering loop (starts_with + throw on unrecognized) was also a latent bug: only high_priority_stream was handled, so passing both high_priority_stream and max_event_pool_size would throw on the second key. Replace the starts_with loops in NCCL/NCCLX/RCCL/RCCLX/XCCL with direct contains() lookups, matching the pattern already used for max_event_pool_size and other keys. Add skip sets in the bootstrap populateNcclConfigFromHints functions so the TorchComm-layer keys don't trigger spurious "unsupported hint" warnings. Update all tests and documentation accordingly. No external callers use the torchcomm:: prefix -- the change is fully contained within comms/torchcomms/. Differential Revision: D95712701
Summary: Move hint key string constants (e.g. kHintHighPriorityStream, kHintMaxEventPoolSize) from anonymous namespaces in .cpp files to their respective headers across all backends (NCCL, NCCLX, RCCL, RCCLX, XCCL, MCCL). This makes the constants accessible to tests and other translation units. Update tests and bootstrap skip sets to use the named constants instead of duplicated magic strings. Differential Revision: D95748619
pavanbalaji
added a commit
to pavanbalaji/torchcomms-1
that referenced
this pull request
Mar 11, 2026
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Reviewed By: kapilsh Differential Revision: D95748622
95f481c to
7b6135e
Compare
Summary: Pull Request resolved: meta-pytorch#994 Add a templated getHint<T>() method on CommOptions that handles hint lookup and type conversion in one call. This replaces the repeated contains()/at()/stoull()/string_to_bool() pattern across all backends with a single concise call. Supports bool (via string_to_bool), size_t (via stoull), and std::string return types with explicit template instantiations. Reviewed By: kapilsh Differential Revision: D95748622
7b6135e to
0326a40
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add a templated getHint() method on CommOptions that
handles hint lookup and type conversion in one call. This
replaces the repeated contains()/at()/stoull()/string_to_bool()
pattern across all backends with a single concise call.
Supports bool (via string_to_bool), size_t (via stoull),
and std::string return types with explicit template
instantiations.
Differential Revision: D95748622