Skip to content

[TRITON][GLUON] Fixing Python 3.14 Compatibility Issue About @aggregate - #4508

Merged
vgokhale merged 8 commits into
mainfrom
cagri/py314_compat
Aug 4, 2026
Merged

vgokhale merged 8 commits into
mainfrom
cagri/py314_compat

Conversation

@cagrikymk

Copy link
Copy Markdown
Contributor

Motivation

Triton's @aggregate builds hash_attrs from inspect.getmembers. On Python 3.14 (PEP 649), the Triton walker attempts to use the annotate member (new in Python 3.14) when updating the kernel hash, and the JIT's record_reference rejects it with "Unsupported function referenced". Hence, the compilation fails.

Technical Details

Due to the mentioned issue, gluon kernels that contain @aggregate fails to compile with Python 3.14. This issue is fixed in upstream Triton (triton-lang/triton#9529). However, no official triton releases contain this PR and it leads to compilation issues when using Python 3.14.

This PR strips that problematic annotate function before the aggregate function to resolve the compilation issue.

Test Plan

Test Result

Submission Checklist

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 4508 --add-label <label>

@cagrikymk
cagrikymk marked this pull request as ready for review August 4, 2026 16:14
@cagrikymk
cagrikymk requested a review from a team August 4, 2026 16:14
@cagrikymk

Copy link
Copy Markdown
Contributor Author

The compatibility matrix:

Python Triton without this PR with this PR
3.14.5 3.7.1 ❌ FAIL — RuntimeError: Unsupported function referenced: <function LoaderConfig.__annotate__> ✅ OK
3.14.5 ToT 3.8.0 ✅ OK ✅ OK
3.12.13 3.7.1 ✅ OK ✅ OK
3.12.13 ToT 3.8.0 ✅ OK ✅ OK

@vgokhale
vgokhale merged commit 8a9b414 into main Aug 4, 2026
56 checks passed
@vgokhale
vgokhale deleted the cagri/py314_compat branch August 4, 2026 22:47
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.

2 participants