Repository navigation
[autotuner] Match direct CuTe configuration facts to the requested device - #4750
Merged
Merged
Conversation
choijon5
force-pushed
the
choijon5/helion-b200/shared/2
branch
from
November 26, 2026 16:22
055630d to
adf97d7
Compare
choijon5
force-pushed
the
choijon5/helion-b200/shared/1
branch
from
November 26, 2026 16:22
a0ca54e to
3d5fd78
Compare
This was referenced Nov 26, 2026
choijon5
marked this pull request as draft
November 26, 2026 17:02
choijon5
force-pushed
the
choijon5/helion-b200/shared/2
branch
from
November 26, 2026 17:03
adf97d7 to
4bc12b8
Compare
choijon5
marked this pull request as ready for review
November 26, 2026 17:04
jansel
approved these changes
Nov 27, 2026
…vice A direct config for a B200 could validate against the current H100 even while it recorded the B200's 148 SMs. Direct configuration under a simulated CuTe target could also observe the host capability or only one SM while a bound kernel correctly used the simulated facts. Read the canonical capability from its module at query time. The explicit-device hook delegates to the existing no-argument backend hook by default; CuTe probes the requested device unless the existing hook was overridden. Bound-kernel facts, including an explicit None, take priority. A nonexistent visible CUDA ordinal gives an unknown capability. Detect it on Torch's specific invalid-device assertion, then confirm it is out of range: successful queries keep their cache fast path, and unrelated driver or initialization errors still propagate. Model both direct and bound SM counts in the target context. Hide the indexed capability reader itself in the unavailable-CUDA fixture, so it neither fills the process's real cache with None nor exposes a warm entry; an outer modeled public probe remains authoritative. A CUDA process using PyTorch's NVML-based check can regain visibility before CUDA initializes. Return None for the unavailable probe without caching it: the next request can read the device, and a successful cached explicit lookup needs no further availability or property checks. The flash and config tests that used the former private search-surface probe now patch the canonical name; the redundant resource-test patch is gone. Testing: Scoped scripts/run_tests.py CPU configuration, helper and flash lanes passed 548 (20 skipped) CuTe and 143 (7 skipped) stable CI Triton. Strict lint and Pyrefly passed. The cold zero-to-one test previously returned None twice; now no absent entry is cached, the restored ordinal gives SM100, and no CUDA availability or property call is made on the next hit. Current-H100/requested-B200 gives SM90/120 and SM100/148; explicit None gives None/148. Class, subclass and plugin overrides, outer facts and the one-visible-device invalid-ordinal controls are exercised. The 25,987 full standalone CuTe CPU passes (567 skips) were on an earlier revision; the current counts above refer to the scoped tests. Integrated validation before changing the unavailable-cache miss to be retried: full CuTe lanes passed 26,211 CPU and 16,138 GPU tests on B200 3/5; full Triton lanes passed 4,900 CPU and 3,395 GPU tests on B200 6; Pallas interpreter passed 269 with 44 skipped. These runs include the requested-device, unavailable-ordinal, legacy-hook and fixture fixes. The final cache correction also passed the real zero-to-one transition on B200 4 with PyTorch's NVML-based availability check. No CUDA context was initialized while hidden; exposing the device then gave SM100/148 rather than a cached unknown. The separate real one-visible-device control returned unknown for a missing ordinal and left the visible target correct before and after a cold or warm simulated scope. Review notes: - Deferred: tensor-descriptor admission still uses the current device, including for a bound spec which already supplies the requested capability on upstream main. KNOWN_GAPS.md, tensor-descriptor-choices-use-the-current-gpu. Fixing only the search menu would leave lowering and epilogue decisions inconsistent across heterogeneous targets. Both configuration directions were reproduced; the single-B200 presets do not exercise that hardware mismatch. autoreview passed: claude, codex stack-info: PR: #4750, branch: choijon5/helion-b200/shared/2
choijon5
marked this pull request as draft
November 28, 2026 04:04
choijon5
force-pushed
the
choijon5/helion-b200/shared/2
branch
from
November 28, 2026 04:04
4bc12b8 to
c1896ed
Compare
choijon5
marked this pull request as ready for review
November 28, 2026 04:04
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.
Stacked PRs:
[autotuner] Match direct CuTe configuration facts to the requested device
A direct config for a B200 could validate against the current H100 even
while it recorded the B200's 148 SMs. Direct configuration under a
simulated CuTe target could also observe the host capability or only one
SM while a bound kernel correctly used the simulated facts.
Read the canonical capability from its module at query time. The
explicit-device hook delegates to the existing no-argument backend hook
by default; CuTe probes the requested device unless the existing hook was
overridden. Bound-kernel facts, including an explicit None, take priority.
A nonexistent visible CUDA ordinal gives an unknown capability. Detect it
on Torch's specific invalid-device assertion, then confirm it is out of
range: successful queries keep their cache fast path, and unrelated
driver or initialization errors still propagate.
Model both direct and bound SM counts in the target context. Hide the
indexed capability reader itself in the unavailable-CUDA fixture, so it
neither fills the process's real cache with None nor exposes a warm
entry; an outer modeled public probe remains authoritative.
A CUDA process using PyTorch's NVML-based check can regain visibility
before CUDA initializes. Return None for the unavailable probe without
caching it: the next request can read the device, and a successful
cached explicit lookup needs no further availability or property checks.
The flash and config tests that used the former private search-surface
probe now patch the canonical name; the redundant resource-test patch
is gone.
Testing: Scoped scripts/run_tests.py CPU configuration, helper and flash
lanes passed 548 (20 skipped) CuTe and 143 (7 skipped) stable CI Triton. Strict
lint and Pyrefly passed. The cold zero-to-one test previously returned
None twice; now no absent entry is cached, the restored ordinal gives
SM100, and no CUDA availability or property call is made on the next
hit. Current-H100/requested-B200 gives SM90/120 and SM100/148; explicit
None gives None/148. Class, subclass and plugin overrides, outer facts
and the one-visible-device invalid-ordinal controls are exercised.
The 25,987 full standalone CuTe CPU passes (567 skips) were on an earlier
revision; the current counts above refer to the scoped tests.
Integrated validation before changing the unavailable-cache miss to be
retried: full CuTe lanes passed 26,211 CPU and 16,138 GPU tests on B200
3/5; full Triton lanes passed 4,900 CPU and 3,395 GPU tests on B200 6;
Pallas interpreter passed 269 with 44 skipped. These runs include the
requested-device, unavailable-ordinal, legacy-hook and fixture fixes.
The final cache correction also passed the real zero-to-one transition
on B200 4 with PyTorch's NVML-based availability check. No CUDA context
was initialized while hidden; exposing the device then gave SM100/148
rather than a cached unknown. The separate real one-visible-device
control returned unknown for a missing ordinal and left the visible
target correct before and after a cold or warm simulated scope.
Review notes:
including for a bound spec which already supplies the requested
capability on upstream main. KNOWN_GAPS.md,
tensor-descriptor-choices-use-the-current-gpu. Fixing only the search
menu would leave lowering and epilogue decisions inconsistent across
heterogeneous targets. Both configuration directions were reproduced;
the single-B200 presets do not exercise that hardware mismatch.
autoreview passed: claude, codex