Add SamplingRegistry to decouple profiler sampling from CVAR (#2063)#2063
Open
mlunar-meta wants to merge 1 commit intometa-pytorch:mainfrom
Open
Add SamplingRegistry to decouple profiler sampling from CVAR (#2063)#2063mlunar-meta wants to merge 1 commit intometa-pytorch:mainfrom
mlunar-meta wants to merge 1 commit intometa-pytorch:mainfrom
Conversation
Contributor
|
@mlunar-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100706980. |
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. This decouples the profiler sampling from the hardcoded NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT CVAR, allowing MCCL to control its sampling rate independently via a new MCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT CVAR set on ctranConfig before ctranInit(). Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
c2c2eb1 to
3b5d866
Compare
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Pull Request resolved: meta-pytorch#2063 Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
104f655 to
5272a76
Compare
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Pull Request resolved: meta-pytorch#2063 Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
b14f3ad to
b55633d
Compare
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
mlunar-meta
added a commit
to mlunar-meta/torchcomms
that referenced
this pull request
Apr 14, 2026
…torch#2063) Summary: Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
…torch#2063) Summary: Pull Request resolved: meta-pytorch#2063 Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call. Changes: - Add SamplingRegistry class (SamplingRegistry.h/.cc) with shouldTrace(opCount) method - Add profilingSamplingWeight field to ctranConfig (default: NCCL_CTRAN_ALGO_PROFILING_SAMPLING_WEIGHT) - Profiler::initForEachColl() no longer takes samplingWeight parameter - Update all 7 algorithm call sites to use simplified initForEachColl(opCount) - MCCL sets profilingSamplingWeight on ctranConfig before ctranInit() [See D100730174] - Add SamplingRegistryTest with 5 test cases - Update ProfilerTest to construct Profiler with config-based sampling weight Differential Revision: D100706980
b55633d to
64dff0f
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:
Introduce a SamplingRegistry class in ctran/profiler/ that encapsulates the sampling decision (shouldTrace based on opCount % samplingWeight). The Profiler now reads the sampling weight from ctranConfig at construction instead of receiving it as a parameter at every initForEachColl() call.
Changes:
Differential Revision: D100706980