Skip to content

Fix: disambiguate paged attention event casts#847

Open
puddingfjz wants to merge 1 commit into
hw-native-sys:mainfrom
puddingfjz:fix/paged-attention-event-casts
Open

Fix: disambiguate paged attention event casts#847
puddingfjz wants to merge 1 commit into
hw-native-sys:mainfrom
puddingfjz:fix/paged-attention-event-casts

Conversation

@puddingfjz
Copy link
Copy Markdown
Contributor

Summary

Fix A5 onboard compilation failures in paged-attention AIC kernels by replacing
ambiguous C-style event_t casts with explicit global event_t casts.

A5's onboard toolchain sees both CANN's global event_t and PTO-ISA's
pto::event_t, so a C-style event_t cast can fail name lookup with:

reference to 'event_t' is ambiguous

Scope

  • Update paged-attention AIC kernels in A5 and matching A2/A3 example/ST files.
  • Keep the cast target explicitly global so it selects the CANN intrinsic event type.
  • No Python callable or golden tolerance changes are included.

Validation

  • rg "\(event_t\)" examples tests src python has no remaining matches.
  • clang-format --dry-run --Werror passed on all touched files.
  • git diff --cached --check passed before commit.

This was exposed by st-onboard-a5 in PR #839, specifically:

examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py::TestPagedAttentionUnrollManualScope::test_run

Use explicit global event_t casts in paged attention AIC kernels so A5 onboard builds do not confuse CANN event_t with pto::event_t.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces C-style casts with static_cast<::event_t> in several aic_pv_matmul.cpp files across examples and tests. These changes affect the wait_flag and set_flag calls within the pv_matmul_n_impl function, promoting better C++ practices and type safety. I have no feedback to provide as there were no review comments to evaluate.

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.

1 participant