Repository navigation
test(bnb): opt into the Triton policy at module construction (#4764) - #5179
Merged
Qubitium merged 1 commit intoNov 18, 2026
Merged
Conversation
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
tests/kernels/test_bitsandbytes_rocm_triton.py::test_selected_gpu_module_matches_oracle_without_expanded_storageenabled the bitsandbytes Triton path with a process-wide
configure_kernel(...)after the module was constructed. Since #4585 the module snapshots the
policy in
__init__(WeightOnlyQuantLinear.__init__->self.kernel = snapshot_kernel_config(kernel)), so the late change wascorrectly ignored and the four Triton cases asserted against a module that
never took the Triton path:
This is entry 4 of #4764 (stale test, not a library bug).
Fixes #4764
What Changed
kernel=KernelConfig(bitsandbytes_triton=True)to the moduleconstructor for the
tritonparametrization and drop the laterconfigure_kernel(...)call. The vendor cases are untouched: they still getthe default (process-wide) snapshot and monkeypatch
_triton_backendaway.test_triton_dispatch_falls_back_when_the_input_needs_gradhas the same late-
configure_kernelpattern, so it currently passesvacuously (Triton off). It is not in [TEST] Suite triage at b225a4383 (RTX 4090 + R9700): tests left red by this round's commits (8587f0bcc, bf5adeb6f, 60376e9bd, 34672a767, dfa180ddb, fd8d5245b, d2a0508f7, f201837bc, b225a4383) #4764 and is left unchanged.
Tests
Red on base (
origin/main@fba0d0ec), green with the fix, same command:The emulation only adds the
blackwellfamily key soavailable_for()stopsrejecting this device; the executed code path is the real Triton
matmul_4bitwith the default tile, not a mock.Full file on this host, unemulated (Triton cases skip, no tuned tile for
sm_121):
/root/venv/bin/python -m pytest -q -p no:cacheprovider tests/kernels/test_bitsandbytes_rocm_triton.py # 36 passed, 8 skippedRelated contract suites:
Unverified here: the real Ada (sm_89) / RDNA4 (gfx1201) run, because this host
is a single NVIDIA GB10 (sm_121) with no tuned bitsandbytes tile. The Triton
cases skip without the emulation, and the skip is not counted as native
evidence.
Model Support / Module Plan
Not applicable: test-only change, no model/definition/fusion changes.
Logic Flow Documentation
Not applicable: no control flow or selection-order change.
Kernel Accuracy Requirements
Not applicable to the change itself. The four Triton cases keep comparing
against the independent FP64 decode oracle; the fix only makes them actually
execute the path they assert.
Notes
Also verified on
fba0d0ecwhile triaging #4764: entries 1, 3, 5, 6, 7 and 8now pass (
tests/kernels/test_fp8_kernel.py,tests/test_fp8_bias_range.py,tests/test_tenstorrent_support.py, the two GGUF C++ files,tests/test_auto_module_decoder.py,tests/kernels/test_gptq.py). Entry 2 isfixed (
scripts/marlin_scratch_fixture.pynow passeslayer._kernel_bias(a)),but executing it needs a Marlin JIT build and this host has no CUDA toolkit.
Entry 9 is fixed by gating the test on
requires_nvidia_cuda(); it cannot runon this host either. So all nine entries are addressed; only entry 4 needed a
change in this PR.