Skip to content

fix(ENG-EXPERT-STREAM): fall back to host BF16 when FP8-native device arm refuses - #3141

Merged
localai-org-maint-bot merged 1 commit into
mainfrom
fix/ci-tsan-gemma4-baseline
Sep 11, 2026
Merged

fix(ENG-EXPERT-STREAM): fall back to host BF16 when FP8-native device arm refuses#3141
localai-org-maint-bot merged 1 commit into
mainfrom
fix/ci-tsan-gemma4-baseline

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

The per-expert dispatch chain in RunGemma4Moe had an else-if branch for
fp8_native && ex.is_fp8 that called EnsureGemma4Fp8NativeOnDevice. When
that returned false (every non-ROCm build, including CPU), the branch set
neither fused_mix nor y: the expert computation was skipped entirely, and
the accumulator received whatever the thread-local y scratch held.

Without TSan the scratch contained non-zero garbage from a prior allocation,
so the test passed by accident. Under TSan the allocator zero-initialises
fresh pages, y was all zero, and REQUIRE(AnyNonZero(want)) failed (issue
#2909).

Add an else inside the fp8_native branch that performs the same host BF16
dequant + ExpertGeGLUHost fallback the !fp8_native sibling below already
uses. The fix is minimal: it does not change the dispatch priority, the
device path, or any arm that succeeds.

Closes #2909

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:regolo/glm5.2 [maki]

… arm refuses

The per-expert dispatch chain in RunGemma4Moe had an else-if branch for
`fp8_native && ex.is_fp8` that called EnsureGemma4Fp8NativeOnDevice.  When
that returned false (every non-ROCm build, including CPU), the branch set
neither fused_mix nor y: the expert computation was skipped entirely, and
the accumulator received whatever the thread-local y scratch held.

Without TSan the scratch contained non-zero garbage from a prior allocation,
so the test passed by accident.  Under TSan the allocator zero-initialises
fresh pages, y was all zero, and REQUIRE(AnyNonZero(want)) failed (issue
#2909).

Add an else inside the fp8_native branch that performs the same host BF16
dequant + ExpertGeGLUHost fallback the `!fp8_native` sibling below already
uses.  The fix is minimal: it does not change the dispatch priority, the
device path, or any arm that succeeds.

Closes #2909

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:regolo/glm5.2 [maki]
@localai-org-maint-bot
localai-org-maint-bot merged commit ec23d7b into main Sep 11, 2026
19 of 26 checks passed
@mudler
mudler deleted the fix/ci-tsan-gemma4-baseline branch September 11, 2026 19:05
mudler added a commit that referenced this pull request Sep 11, 2026
Fixes the windows-msvc and role-discipline failures that blocked all
open PRs since 57220ba. The macos-metal-mlx, sanitize-cpu address,
and sanitize-cpu thread failures were already fixed by #3136, #3138,
and #3141.

windows-msvc: kv_cache_utils.cpp used fopen with "re" mode which MSVC
does not support; build-windows-release.ps1 needed a dumpbin path fix

role-discipline: commit 96c5e47 reached main without a row/ branch.
Advances the enforcement floor from e1b5df1 to 96c5e47, the third
advance, forgiving that one unrepairable violation. Re-pins the floor
test assertion in lockstep and adds the third-advance section to the
spec

intake-triage: the spec change surfaced two untriaged _intake records
(#558, #664) whose issue numbers appear in the forgiven-commits table.
Both are already fixed by the tree; triaged #558 to
BENCH-ORACLE-PIN-RECONCILE and #664 to
GATE-WINDOWS-PORTABILITY-TARGET-SCOPE so the agent-record gate passes

Paths: product (src/vllm/v1/core/kv_cache_utils.cpp), script
(scripts/build-windows-release.ps1), checker data
(scripts/ci-enforcement-floor.txt), test
(tests/scripts/test_check_commit_trailers.py), document
(.agents/specs/ci-enforcement-floor.md), record
(.agents/issues/BENCH-ORACLE-PIN-RECONCILE/ISSUE-GH-558.md,
.agents/issues/GATE-WINDOWS-PORTABILITY-TARGET-SCOPE/ISSUE-GH-664.md)

Closes #3135

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:regolo/glm5.2 [maki]
mudler added a commit that referenced this pull request Sep 11, 2026
…ation

Commit 96c5e47 reached main without a row/ branch, freezing the
agent-record gate: every PR based on current main fails it. Advances
the enforcement floor from e1b5df1 to 96c5e47, the third advance,
forgiving that one unrepairable violation. Re-pins the floor test
assertion in lockstep and adds the third-advance section to the spec.

The spec change surfaced two untriaged _intake records (#558, #664)
whose issue numbers appear in the forgiven-commits table. Both are
already fixed by the tree; triaged #558 to BENCH-ORACLE-PIN-RECONCILE
and #664 to GATE-WINDOWS-PORTABILITY-TARGET-SCOPE so the agent-record
gate passes.

The windows-msvc-cpu job fails at test_openai_api_server.exe
(STATUS_STACK_BUFFER_OVERRUN) but is not a required check: PR #3097
merged while it was red. The macos, sanitize-address, and sanitize-
thread failures named in #3135 were fixed by #3136, #3138, and #3141.
This commit resolves the last blocking failure.

Paths: checker data (scripts/ci-enforcement-floor.txt), test
(tests/scripts/test_check_commit_trailers.py), document
(.agents/specs/ci-enforcement-floor.md), record
(.agents/issues/BENCH-ORACLE-PIN-RECONCILE/ISSUE-GH-558.md,
.agents/issues/GATE-WINDOWS-PORTABILITY-TARGET-SCOPE/ISSUE-GH-664.md)

Closes #3135

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:regolo/glm5.2 [maki]
localai-org-maint-bot added a commit that referenced this pull request Sep 12, 2026
…3142)

Commit 96c5e47 reached main without a row/ branch, freezing the
agent-record gate: every PR based on current main fails it. Advances the
enforcement floor from e1b5df1 to 96c5e47, the third advance,
forgiving that one unrepairable violation. Re-pins the floor test
assertion in lockstep and adds the third-advance section to the spec.

The spec change surfaced two untriaged _intake records (#558, #664)
whose issue numbers appear in the forgiven-commits table. Both are
already fixed by the tree; triaged #558 to BENCH-ORACLE-PIN-RECONCILE
and #664 to GATE-WINDOWS-PORTABILITY-TARGET-SCOPE so the agent-record
gate passes.

The windows-msvc-cpu job fails at test_openai_api_server.exe
(STATUS_STACK_BUFFER_OVERRUN) but is not a required check: PR #3097
merged while it was red. The macos, sanitize-address, and
sanitize-thread failures named in #3135 were fixed by #3136, #3138, and
#3141. This commit resolves the last blocking failure.

Paths: checker data (scripts/ci-enforcement-floor.txt), test
(tests/scripts/test_check_commit_trailers.py), document
(.agents/specs/ci-enforcement-floor.md), record
(.agents/issues/BENCH-ORACLE-PIN-RECONCILE/ISSUE-GH-558.md,
.agents/issues/GATE-WINDOWS-PORTABILITY-TARGET-SCOPE/ISSUE-GH-664.md)

Closes #3135

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:regolo/glm5.2 [maki]

Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemma4 FP8 native-arm guard test has a vacuous all-zero baseline under TSan

2 participants