Skip to content

Import get_fp8_dtypes from the correct place in bench_gemm_a8wfp4#2602

Closed
apicciau wants to merge 1 commit intomainfrom
apicciau/fix_fp8_types
Closed

Import get_fp8_dtypes from the correct place in bench_gemm_a8wfp4#2602
apicciau wants to merge 1 commit intomainfrom
apicciau/fix_fp8_types

Conversation

@apicciau
Copy link
Copy Markdown
Contributor

@apicciau apicciau commented Apr 2, 2026

Motivation

When running bench_gemm_a8wfp4.py, the script fails immediately with:

AttributeError: module 'aiter.ops.triton.utils._triton.arch_info' has no attribute 'get_fp8_dtypes'

Technical Details

bench_gemm_a8wfp4.py was calling arch_info.get_fp8_dtypes(), but get_fp8_dtypes is defined in aiter.ops.triton.utils.types, not in arch_info. Fixed by importing and calling it from the correct module, consistent with every other call
site in the codebase (e.g. test_gemm_a8wfp4.py, test_gemm_a8w8.py, etc.).

Test Plan

Run bench_gemm_a8wfp4.py --model all -M 4096 --model-configs ... --metric time --layout TT -o and verify it no longer raises AttributeError.

Test Result

Script launches successfully after the fix.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-355 Run Triton tests on MI355 in addition to MI325
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2602 --add-label <label>

@apicciau apicciau marked this pull request as ready for review April 3, 2026 14:37
@apicciau apicciau requested review from a team, Copilot and lburzawa April 3, 2026 14:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes bench_gemm_a8wfp4.py crashing on startup by importing get_fp8_dtypes from the module where it is actually defined (aiter.ops.triton.utils.types) rather than from arch_info.

Changes:

  • Import get_fp8_dtypes from aiter.ops.triton.utils.types.
  • Replace arch_info.get_fp8_dtypes() call with get_fp8_dtypes().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def bench_gemm_fn(M: int, N: int, K: int, metric: str, layout: str):
e5m2_type, e4m3_type = arch_info.get_fp8_dtypes()
e5m2_type, e4m3_type = get_fp8_dtypes()
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e5m2_type is assigned but never used. With the repo’s Ruff check enabled in CI, this will likely raise F841 on this changed line. Use _ for the unused return value (or otherwise use e5m2_type) to avoid lint failures.

Suggested change
e5m2_type, e4m3_type = get_fp8_dtypes()
_, e4m3_type = get_fp8_dtypes()

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion makes sense IMHO.

Copy link
Copy Markdown
Contributor

@brunomazzottiamd brunomazzottiamd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


def bench_gemm_fn(M: int, N: int, K: int, metric: str, layout: str):
e5m2_type, e4m3_type = arch_info.get_fp8_dtypes()
e5m2_type, e4m3_type = get_fp8_dtypes()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion makes sense IMHO.

@azaidy
Copy link
Copy Markdown
Contributor

azaidy commented Apr 7, 2026

A similar fix should have been merged as part of #2434. Please check if main works. If not, please resolve conflicts and we can discuss

@apicciau
Copy link
Copy Markdown
Contributor Author

Confirmed: this fix is already on main via #2434 (merged 2026-04-07). Lines 22 and 26 of op_tests/op_benchmarks/triton/bench_gemm_a8wfp4.py now import and call get_fp8_dtypes from aiter.ops.triton.utils.types, exactly as this PR intended. Closing as superseded.

@apicciau apicciau closed this Apr 17, 2026
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.

4 participants