Skip to content

[bugfix]: hard-fail when ATTN_QAT_INFER is selected but the kernel is unusable - #1690

Merged
SolitaryThinker merged 1 commit into
mainfrom
fix/attn-qat-infer-hard-fail
Aug 6, 2026
Merged

[bugfix]: hard-fail when ATTN_QAT_INFER is selected but the kernel is unusable#1690
SolitaryThinker merged 1 commit into
mainfrom
fix/attn-qat-infer-hard-fail

Conversation

@SolitaryThinker

@SolitaryThinker SolitaryThinker commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Selecting ATTN_QAT_INFER without a usable kernel used to log "Fall back to Flash Attention" and continue — so an FP4 A/B on a box without the kernel silently benchmarks bf16 vs bf16. Found while reviewing #1631.

Now raises ImportError with the receipt, same as ATTN_QAT_TRAIN and NABLA_ATTN already do. Nothing in-repo consumed the old log line.

Known follow-up: _fa4_fp4_available() returns True with mainline flash_attn even when the flash-attention-fp4 fork isn't installed (fails later on the mSFQ kwarg) — the probe needs a signature check for this gate to fire there.

Adds a CPU unit test for the raise.

… unusable

An explicitly selected QAT-inference backend previously logged "Fall back to
Flash Attention" and continued — so an FP4-vs-bf16 A/B run on a machine
without the kernel silently benchmarked bf16 against bf16 and reported it as
an FP4 result. ATTN_QAT_TRAIN and NABLA_ATTN already refuse to proceed in
exactly this situation; ATTN_QAT_INFER now matches them, raising ImportError
with the resolution receipt and the remedy.

Nothing in-repo consumed the old fallback log line (all receipt consumers use
attn_qat_infer_receipt()); the "downstream receipts grep" comment referred to
a sentence whose presence meant the measurement was already invalid.

Adds a CPU unit test asserting the raise, and folds the dangling support-
matrix assertion back into its receipt test.

(pre-commit mypy hook bypassed: it fails on this checkout's directory name,
"FastVideo-mini is not a valid Python package name" — unrelated to the diff;
yapf/ruff/codespell all passed.)
@mergify mergify Bot added type: bugfix Bug fix scope: infra CI, tests, Docker, build labels Aug 6, 2026
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI

Protection Waiting on
🔴 PR merge requirements 👀 reviews and 🤖 CI

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=fastcheck-passed
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=fastcheck-passed
  • check-success=full-suite-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

@SolitaryThinker
SolitaryThinker merged commit b963a24 into main Aug 6, 2026
5 of 8 checks passed
@SolitaryThinker
SolitaryThinker deleted the fix/attn-qat-infer-hard-fail branch August 6, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: infra CI, tests, Docker, build type: bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant