Skip to content

[Fix] moe: Fix flashinfer TRT-LLM BF16 expert weight reload on refit - #33743

Merged
nvpohanh merged 30 commits into
sgl-project:mainfrom
Kh4L:moe-trtllm-bf16-hot-reload-layout
Oct 27, 2026
Merged

nvpohanh merged 30 commits into
sgl-project:mainfrom
Kh4L:moe-trtllm-bf16-hot-reload-layout

Conversation

@Kh4L

@Kh4L Kh4L commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

BF16 MoE expert weights are converted to the FlashInfer TRT-LLM BlockMajorK
layout on cold load. The inverse restore previously ran only for the routed
backend, although both flashinfer_trtllm and flashinfer_trtllm_routed use
the transform. A subsequent checkpoint-format copy into a blocked parameter
can therefore fail with:

The size of tensor a (64) must match the size of tensor b (2048) at
non-singleton dimension 2

A shape-only restore is insufficient: unchanged expert values must also be
returned to checkpoint order before the next pack, or repeated refits can
silently scramble them.

Fixes #27787

Modifications

  1. Gate the inverse on use_flashinfer_trtllm_moe, matching the transform for
    both routed and non-routed BF16 backends.
  2. Restore both the canonical shape and values in place, preserving parameter
    storage and rejecting non-bijective row permutations or wrong element counts.
  3. Implement restore_weights_before_loading so begin_weight_update restores
    both expert parameters for direct tensor and P2P/RDMA writes that bypass
    model weight loaders. Retain loader-side restoration for disk reloads,
    which do not open a weight-update session.
  4. Shape-guard the post-load pack: canonical weights are converted to kernel
    layout, while already-blocked weights remain unchanged. The existing
    end_weight_update finalizes once per session, not once per bucket, using
    the existing LoRA-aware model-loader traversal. No new updater/base hook or
    per-bucket finally callback is introduced.

Files changed relative to main:
python/sglang/srt/layers/quantization/unquant.py and
test/registered/unit/layers/quantization/test_flashinfer_trtllm_bf16_moe_reload.py.

Accuracy Tests

The CPU-registered unit file contains 10 test methods. It covers exact layout
round trips, bucketed tensor/flattened/distributed updates, mixed
canonical/blocked parameters, unchanged and inactive-backend behavior, invalid
permutations and element counts, LoRA-wrapped traversal, and three successive
loader-free refits through both direct tensor updates and simulated P2P flat
copies. Runtime topology is scoped with get_parallel().override(tp_rank=0).
Loader-free tests assert exact cold-load byte equality and unchanged storage
pointers, while forbidding any call to the model weight loader.

October 5 validation of commit 493fab0f593649c3c22a19302bab1b597a70aada,
including main 70f0b7351e74b372cc928db533824d3993d65922: all 10 methods and
5 format subtests pass, plus 22 nearby session/cache-guard methods. Controls
reproduce the three pre-fix TP-rank failures and fail the new loader-free case
in both formats when only the production restore hook is removed. Native XML,
exact source hashes and terminal accounting were independently checked;
all applicable pinned pre-commit hooks pass.
FlashInfer's layout entry points are deterministic, order-changing CPU
stand-ins; this is not on-device kernel accuracy, real RDMA transport, or
end-to-end RL validation.

Speed Tests and Profiling

No speed benchmark is claimed. Forward kernels are unchanged. Canonical restore
and pack are paid once per weight-update session; disk reloads retain their
existing load/postprocess lifecycle. This fixes representation correctness,
not rollback of partially written weight values.

Checklist

  • Format code with the pinned pre-commit configuration.
  • Add CPU-registered regression coverage with failure controls.
  • Update external documentation if needed.
  • Provide on-device accuracy and speed benchmark results.
  • Follow SGLang code style guidance.

Review and Merge Process

Required review and green CI remain necessary. Full upstream GPU CI needs a
maintainer to restore the run-ci gate; no fresh GPU CI success is claimed.


CI States

Latest PR Test (Base): ✅ Run #39687984610
Latest PR Test (Extra): ❌ Run #39687984537
Latest PR Test (AMD ROCm 10): ❌ Run #39687984561

@github-actions github-actions Bot added the quant LLM Quantization label Aug 5, 2026
Kh4L added a commit to Kh4L/NemoRL that referenced this pull request Aug 5, 2026
SGLang auto-selects flashinfer_trtllm on sm100 for bf16 MoE, but stock
0.5.12.post1 rewrites expert weights into a block layout that its
weight-update path never undoes, so the first refit bucket dies with
"size of tensor a (64) must match the size of tensor b (2048) at
non-singleton dimension 2". Until now the recipe pinned moe_runner_backend
to triton to avoid the block layout entirely.

Apply the upstream fix (sgl-project/sglang#33743, fixing #27787) to the
installed sglang during the image build. sglang arrives as a PyPI wheel
whose srt/ tree is pure Python, so the fix needs no forked wheel; the
applier patches every venv and the uv cache archive they link into, and
hard-fails unless all of them carry it. The vendored file is the
v0.5.12.post1 backport of that PR -- the PR targets main, where the
hot-update paths have since moved -- and is executable-code-identical to
it. Delete it once the fix is in the pinned SGLang release.

Switch the 32n4g recipe to flashinfer_trtllm, which on GB200 at tp=2
decodes 11-30% faster than triton across batch sizes 1-32, and +17% at the
~2 concurrent requests per engine this recipe produces.

Validated on GB200: bit-exact generation, max abs logprob delta 0.0, over
an adversarially bucketed push of all 18867 checkpoint tensors for
flashinfer_trtllm, flashinfer_trtllm_routed and triton; and 4/4 refits in
a 32-node async-GRPO run (status=passed, world_size=65 engines=32).

Also record the two load-bearing launch overrides the refit guide omitted.

Signed-off-by: Serge Panev <[email protected]>
@Kh4L
Kh4L force-pushed the moe-trtllm-bf16-hot-reload-layout branch from 4bae2c9 to 3acb407 Compare August 5, 2026 19:19
@nvpohanh

nvpohanh commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@Kh4L could you fix the conflicts? thanks!

@b8zhong b8zhong self-assigned this Aug 6, 2026
@Kh4L
Kh4L force-pushed the moe-trtllm-bf16-hot-reload-layout branch from 3acb407 to 14712d8 Compare August 6, 2026 18:57
@nvpohanh

nvpohanh commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

@Kh4L could you rebase/merge with main again? github action was broken

@nvpohanh nvpohanh added the bug Something isn't working label Aug 10, 2026
Kh4L added a commit to Kh4L/NemoRL that referenced this pull request Aug 10, 2026
…atch

sglang 0.5.13 pulls its companions with it: sglang-kernel 0.4.3, flashinfer
0.6.12, transformers 5.8.1 and kernels >=0.14.1,<0.15. None of them resolve
alone -- uv rejects the set until all seven move together.

0.5.13 still carries the bug (unquant.py gates the inverse transform on
is_flashinfer_trtllm_routed() alone), and sgl-project/sglang#33743 is still
open, so the vendored patch stays. But it has to be retargeted rather than
carried over, because 0.5.13 sits between v0.5.12.post1 and upstream main:

- it keeps the hot-update entry points in model_executor/model_runner.py, so
  that hunk is the v0.5.12.post1 one (main moved them to weight_updater.py)
- it has already moved to the four-argument
  _maybe_get_cached_w3_w1_permute_indices(..., is_gated_act_gemm=...), so
  base_config.py and unquant.py come from the PR's main-branch version

Force-applying the old backport with fuzz would have reverted that call to
three arguments and changed the permutation for non-gated MoE models -- wrong
weights, and no shape check would have caught it.

One hunk exists in neither upstream form: replacing the inline flashinfer block
in process_weights_after_loading with the extracted helper. Reconciled by hand
against the 0.5.13 tree, then verified to apply cleanly to a pristine checkout,
round-trip byte-exact, call the helper exactly once, and expose all six
patch-added methods.

The patch REPLACES rather than joins the old one: the applier globs *.patch and
applies every file it finds, so two variants targeting the same source would
conflict.

Not yet exercised on hardware at 0.5.13 -- the GB200 evidence in the README is
against the v0.5.12.post1 backport.

Signed-off-by: Serge Panev <[email protected]>
@Kh4L
Kh4L force-pushed the moe-trtllm-bf16-hot-reload-layout branch from 14712d8 to 5cfc305 Compare August 12, 2026 21:43
@nvpohanh

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Aug 13, 2026
@nvpohanh

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] I've started babysitting the NVIDIA CI of this PR. I'll check it every 30 minutes until all NV pipelines pass. If a relevant job fails, I may rerun it, merge the latest main into this branch, push a small test-only fix, or post a note here.

Anyone can stop me at any time: just post a comment asking me to stop (for example, stop babysitting). I'll stop at my next check, within 30 minutes, and take no further action on this PR.

nvpohanh and others added 2 commits October 13, 2026 20:56
Picks up the updated required base commit ff8d964 from CI maintenance issue sgl-project#21065; the check-maintenance gate blocked CI with "Rebase Required" (https://github.com/sgl-project/sglang/actions/runs/38509251941/job/115677768029).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wuxibin89 pushed a commit to verl-project/verl that referenced this pull request Oct 14, 2026
…ts on Blackwell (#8230)

### What does this PR do?

Fixes #8229: on Blackwell, a bf16 SGLang rollout of a Qwen3-MoE model
crashes at the first weight sync.

On compute capability 10.x, SGLang resolves `moe_runner_backend=auto` to
`flashinfer_trtllm` for unquantized Qwen3-MoE-family checkpoints. That
runner keeps bf16 expert weights in a block layout, and
`update_weights_from_tensor` restores the load-time shape only for
`flashinfer_trtllm_routed`. The first sync therefore fails in
`FusedMoE._load_w13` (`The size of tensor a (64) must match the size of
tensor b (512)`), and the SGLang scheduler exits. Upstream:
sgl-project/sglang#27787. It still reproduces on sglang 0.5.20 and
0.5.21; the fixes in sgl-project/sglang#33743 and
sgl-project/sglang#44163 are not merged.

This PR has verl ask SGLang for the Triton MoE runner under the same
conditions in which SGLang picks `flashinfer_trtllm` on sm100 (its
Qwen3-MoE- and DeepSeek-family rules), that is when all of the following
hold:
- neither the rollout nor the checkpoint is quantized:
`rollout.quantization` is unset and the HF config has no
`quantization_config`, which SGLang would detect on its own;
- `engine_kwargs.sglang.moe_runner_backend` is unset or `auto`;
- `engine_kwargs.sglang.moe_a2a_backend` is unset or `none`;
- the GPU is CUDA with compute capability 10.x.

Triton is the runner SGLang's unquantized MoE method falls back to
everywhere else, and it takes weight updates. The following keep
SGLang's own choice:
- quantized rollouts or checkpoints;
- an a2a backend;
- an explicit runner;
- Hopper and other GPUs;
- ROCm.

The architecture lists are not copied. On other architectures SGLang
already lands on Triton, so the default changes nothing there.

### Checklist Before Starting

- [x] Search for similar PRs. No open issue or PR covers this:
-
[moe_runner_backend](https://github.com/verl-project/verl/pulls?q=is%3Apr+moe_runner_backend)
- [flashinfer_trtllm
bf16](https://github.com/verl-project/verl/pulls?q=is%3Apr+flashinfer_trtllm+bf16)
  - [_load_w13](https://github.com/verl-project/verl/issues?q=_load_w13)

The closest is #7978 (closed), the same failure mode on vLLM's TRT-LLM
MoE backend.
- [x] Format the PR title as `[{modules}] {type}: {description}`

### Test

- **CPU unit test, run and then removed at review:** a 16-case test of
`default_moe_runner_backend` (each condition above, `engine_kwargs` as
an OmegaConf `DictConfig`, ROCm, and capabilities 9.0, 10.0, 10.3, 12.0
and unknown) passed locally: 25 passed together with
`test_lora_merge_mode_on_cpu.py`. A maintainer asked to drop it, and
`e8080be0` removes it.
- **pre-commit on the changed files:** ruff, ruff format, mypy, license,
docstring coverage, device API usage and test structure all pass.
`autogen-trainer-cfg` could not run locally because hydra-core is
missing there; no config file changes.
- **On 1×B200**, this PR against its base on the same pod with the same
config; nothing sets `moe_runner_backend`. Environment: verl main's
`uv.lock` (sglang 0.5.20, flashinfer 0.6.18, TE 2.16.1, torch
2.13.0+cu130), Megatron backend, a random 2-layer Qwen3-MoE (8 experts),
GSM8K, bf16 SGLang rollout, 4 steps.

  | verl | MoE runner | Result |
  |---|---|---|
| this PR (`8b9ca7df`) | Triton, picked by this PR. Server log: `sglang
moe_runner_backend=triton: SGLang's default on Blackwell cannot take
bf16 weight updates (sgl-project/sglang#27787); ...` | 4/4 steps, exit
0. rollout_corr/kl by step: 1.8e-4, 6.1e-5, 1.2e-4, 4.3e-5 |
| base main (`2bc6ac46`) | SGLang's default `flashinfer_trtllm` (the
server autotunes `flashinfer::trtllm_bf16_moe`) | Fails at the first
weight sync: `RuntimeError: The size of tensor a (64) must match the
size of tensor b (512) at non-singleton dimension 2` in
`FusedMoE._load_w13`, then "Scheduler hit an exception" and exit 1 |

On that GPU (compute capability 10.0), `default_moe_runner_backend`
returns `"triton"` for bf16, `None` for fp8, and `None` when a runner is
set explicitly.

These runs used `8b9ca7df`, before `1d2f5ad5` narrowed the conditions
above. The validated case meets every one of them, so the result carries
over: a bf16 rollout of an unquantized checkpoint, no a2a backend,
runner unset.

### API and Usage Example

No API change. To keep SGLang's own choice on Blackwell, set it
explicitly, for example:

```
+actor_rollout_ref.rollout.engine_kwargs.sglang.moe_runner_backend=flashinfer_trtllm
```

### Design & Code Changes

- `verl/workers/rollout/sglang_rollout/utils.py`: new
`default_moe_runner_backend(quantization, engine_kwargs, hf_config)`. It
returns `"triton"` under the conditions listed above, and `None`
otherwise, which keeps SGLang's choice.
- `verl/workers/rollout/sglang_rollout/async_sglang_server.py`:
`launch_server` passes the rollout quantization, `engine_kwargs` and the
model's HF config, applies the result to the server args, and logs the
choice.

The default can be dropped once SGLang restores the layout for
`flashinfer_trtllm` itself.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/verl-project/verl/blob/main/CONTRIBUTING.md).
- [x] Apply pre-commit checks (see Test; `autogen-trainer-cfg` needs
hydra-core, no config changes here).
- [ ] Add / Update the documentation: not needed, no user-facing option
changes.
- [ ] Add unit test(s): none in the final diff; the CPU test was removed
at review (see Test).
- [ ] Once your PR is ready for CI, send a message in the `ci-request`
channel.

AI assistance was used for the investigation, the code change and this
description.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@nvpohanh nvpohanh changed the title [MoE] Fix flashinfer TRT-LLM BF16 expert weight reload on refit [Fix] moe: Fix flashinfer TRT-LLM BF16 expert weight reload on refit Oct 15, 2026
@nvpohanh

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@nvpohanh

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] I've started babysitting the NVIDIA CI of this PR. I'll check it every 30 minutes until all NV pipelines pass. If a relevant job fails, I may rerun it, merge the latest main into this branch, push a small test-only fix, fix the PR title if the title check fails, or post a note here.

Anyone can stop me at any time: just post a comment asking me to stop (for example, stop babysitting). I'll stop at my next check, within 30 minutes, and take no further action on this PR.

@nvpohanh

Copy link
Copy Markdown
Collaborator

[by Claude Code] All NV pipelines have passed.

@nvpohanh

Copy link
Copy Markdown
Collaborator

@Fridge003 could you help to review this change that is required for RL rollout? Thanks!

@mintlify

mintlify Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit c0ae146.

Approve preview

@nvpohanh

Copy link
Copy Markdown
Collaborator

@Fridge003 @ispobock could you review this? Thanks!

@nvpohanh

Copy link
Copy Markdown
Collaborator

Merging this since this is a low-risk, non-architectural change: only affecting unquant (BF16) MoE path with trtllm-gen backend. This is typically only used in RL. This PR fixes a long-standing RL failure when using SGLang rollout. Full CI has passed.

@kahyunnam

Copy link
Copy Markdown
Contributor

Status: fixed on SGLang main since this PR (merged 2026-10-27); not yet in a release, no FlashInfer change needed.

What we found: the first RL weight-sync crash in FusedMoE._load_w13 (#27787) came from the BF16 flashinfer_trtllm runner not restoring FlashInfer's block-major weight layout before the update, which this PR fixes. The newest SGLang release, v0.5.22, predates the fix, so verl's forced moe_runner_backend=triton on CC 10.x (verl-project/verl#8230) is still needed until the next release. The FlashInfer helpers this PR uses (convert_to_block_layout and the permute-index helpers) were checked on a Blackwell CC 10.0 GPU for Qwen3-30B-A3B and Qwen3.5-35B-A3B at TP 1 to 8, gated and non-gated, w13 and w2, over three refit cycles: every restore returned the previous bytes exactly and every repack matched a cold pack. One pre-existing limit: Qwen3-30B-A3B at TP8 has a w2 K of 96, which convert_to_block_layout rejects, so BF16 flashinfer_trtllm cannot run that configuration. The fix also calls the private helper _maybe_get_cached_w3_w1_permute_indices; its signature is stable today, but a future rename would break RL refit.

Next steps:

  1. verl maintainers: once an SGLang release carries this fix, drop or version-gate the Triton override and drive refits through begin_weight_update / end_weight_update.
  2. slime maintainers: confirm whether slime forces Triton at all, and whether fix(update_weight): restore FlashInfer MoE layout after BF16 hot updates THUDM/slime#2192's extra post_process_weights is still needed on top of end_weight_update.
  3. FlashInfer maintainers: consider a public inverse of the BF16 block layout plus a round-trip unit test, so SGLang stops importing a private name.

@wengeezhang @LLMShark: does either framework still need the override after this fix?

thecourageyu pushed a commit to thecourageyu/verl that referenced this pull request Nov 11, 2026
…ts on Blackwell (verl-project#8230)

### What does this PR do?

Fixes verl-project#8229: on Blackwell, a bf16 SGLang rollout of a Qwen3-MoE model
crashes at the first weight sync.

On compute capability 10.x, SGLang resolves `moe_runner_backend=auto` to
`flashinfer_trtllm` for unquantized Qwen3-MoE-family checkpoints. That
runner keeps bf16 expert weights in a block layout, and
`update_weights_from_tensor` restores the load-time shape only for
`flashinfer_trtllm_routed`. The first sync therefore fails in
`FusedMoE._load_w13` (`The size of tensor a (64) must match the size of
tensor b (512)`), and the SGLang scheduler exits. Upstream:
sgl-project/sglang#27787. It still reproduces on sglang 0.5.20 and
0.5.21; the fixes in sgl-project/sglang#33743 and
sgl-project/sglang#44163 are not merged.

This PR has verl ask SGLang for the Triton MoE runner under the same
conditions in which SGLang picks `flashinfer_trtllm` on sm100 (its
Qwen3-MoE- and DeepSeek-family rules), that is when all of the following
hold:
- neither the rollout nor the checkpoint is quantized:
`rollout.quantization` is unset and the HF config has no
`quantization_config`, which SGLang would detect on its own;
- `engine_kwargs.sglang.moe_runner_backend` is unset or `auto`;
- `engine_kwargs.sglang.moe_a2a_backend` is unset or `none`;
- the GPU is CUDA with compute capability 10.x.

Triton is the runner SGLang's unquantized MoE method falls back to
everywhere else, and it takes weight updates. The following keep
SGLang's own choice:
- quantized rollouts or checkpoints;
- an a2a backend;
- an explicit runner;
- Hopper and other GPUs;
- ROCm.

The architecture lists are not copied. On other architectures SGLang
already lands on Triton, so the default changes nothing there.

### Checklist Before Starting

- [x] Search for similar PRs. No open issue or PR covers this:
-
[moe_runner_backend](https://github.com/verl-project/verl/pulls?q=is%3Apr+moe_runner_backend)
- [flashinfer_trtllm
bf16](https://github.com/verl-project/verl/pulls?q=is%3Apr+flashinfer_trtllm+bf16)
  - [_load_w13](https://github.com/verl-project/verl/issues?q=_load_w13)

The closest is verl-project#7978 (closed), the same failure mode on vLLM's TRT-LLM
MoE backend.
- [x] Format the PR title as `[{modules}] {type}: {description}`

### Test

- **CPU unit test, run and then removed at review:** a 16-case test of
`default_moe_runner_backend` (each condition above, `engine_kwargs` as
an OmegaConf `DictConfig`, ROCm, and capabilities 9.0, 10.0, 10.3, 12.0
and unknown) passed locally: 25 passed together with
`test_lora_merge_mode_on_cpu.py`. A maintainer asked to drop it, and
`e8080be0` removes it.
- **pre-commit on the changed files:** ruff, ruff format, mypy, license,
docstring coverage, device API usage and test structure all pass.
`autogen-trainer-cfg` could not run locally because hydra-core is
missing there; no config file changes.
- **On 1×B200**, this PR against its base on the same pod with the same
config; nothing sets `moe_runner_backend`. Environment: verl main's
`uv.lock` (sglang 0.5.20, flashinfer 0.6.18, TE 2.16.1, torch
2.13.0+cu130), Megatron backend, a random 2-layer Qwen3-MoE (8 experts),
GSM8K, bf16 SGLang rollout, 4 steps.

  | verl | MoE runner | Result |
  |---|---|---|
| this PR (`8b9ca7df`) | Triton, picked by this PR. Server log: `sglang
moe_runner_backend=triton: SGLang's default on Blackwell cannot take
bf16 weight updates (sgl-project/sglang#27787); ...` | 4/4 steps, exit
0. rollout_corr/kl by step: 1.8e-4, 6.1e-5, 1.2e-4, 4.3e-5 |
| base main (`2bc6ac46`) | SGLang's default `flashinfer_trtllm` (the
server autotunes `flashinfer::trtllm_bf16_moe`) | Fails at the first
weight sync: `RuntimeError: The size of tensor a (64) must match the
size of tensor b (512) at non-singleton dimension 2` in
`FusedMoE._load_w13`, then "Scheduler hit an exception" and exit 1 |

On that GPU (compute capability 10.0), `default_moe_runner_backend`
returns `"triton"` for bf16, `None` for fp8, and `None` when a runner is
set explicitly.

These runs used `8b9ca7df`, before `1d2f5ad5` narrowed the conditions
above. The validated case meets every one of them, so the result carries
over: a bf16 rollout of an unquantized checkpoint, no a2a backend,
runner unset.

### API and Usage Example

No API change. To keep SGLang's own choice on Blackwell, set it
explicitly, for example:

```
+actor_rollout_ref.rollout.engine_kwargs.sglang.moe_runner_backend=flashinfer_trtllm
```

### Design & Code Changes

- `verl/workers/rollout/sglang_rollout/utils.py`: new
`default_moe_runner_backend(quantization, engine_kwargs, hf_config)`. It
returns `"triton"` under the conditions listed above, and `None`
otherwise, which keeps SGLang's choice.
- `verl/workers/rollout/sglang_rollout/async_sglang_server.py`:
`launch_server` passes the rollout quantization, `engine_kwargs` and the
model's HF config, applies the result to the server args, and logs the
choice.

The default can be dropped once SGLang restores the layout for
`flashinfer_trtllm` itself.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/verl-project/verl/blob/main/CONTRIBUTING.md).
- [x] Apply pre-commit checks (see Test; `autogen-trainer-cfg` needs
hydra-core, no config changes here).
- [ ] Add / Update the documentation: not needed, no user-facing option
changes.
- [ ] Add unit test(s): none in the final diff; the CPU test was removed
at review (see Test).
- [ ] Once your PR is ready for CI, send a message in the `ci-request`
channel.

AI assistance was used for the investigation, the code change and this
description.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation quant LLM Quantization run-ci CI: run the baseline test suite on this PR

Projects

None yet

7 participants