Skip to content

Conversation

@ypapadop-amd
Copy link
Contributor

@ypapadop-amd ypapadop-amd commented Jan 7, 2026

Motivation

When either malformed packets were queued or a submission error happened, the error would be swallowed in Release builds.

Technical Details

Replacing asserts() with exceptions which will propagate to the public API and will cause an abort() for easier debugging.

JIRA ID

NA

Test Plan

Local testing on Phoenix NPU.

Test Result

If the kernel is given an argument to non-NPU memory, the following is reported:

HSA exception: Invalid packet header
Aborted (core dumped)

and execution aborts.

Submission Checklist

@ypapadop-amd ypapadop-amd self-assigned this Jan 7, 2026
Copilot AI review requested due to automatic review settings January 7, 2026 21:44
Copy link
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

This PR improves error handling in the AIE AQL queue implementation by replacing silent failures with exceptions. The changes ensure that malformed packets and submission errors are properly propagated to the public API instead of being silently swallowed in Release builds, making debugging easier.

Key changes:

  • Replaced assert() calls with throw hsa_exception() for packet validation and submission errors
  • Simplified exception throwing by removing redundant AMD:: namespace prefix
  • Added #include <cassert> header (though cassert is no longer used after these changes)

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

@ypapadop-amd ypapadop-amd force-pushed the users/ypapadop-amd/aie-queue-throw-exception branch from 1dc903d to b2eaba1 Compare January 8, 2026 18:44
@ypapadop-amd ypapadop-amd force-pushed the users/ypapadop-amd/aie-queue-throw-exception branch 4 times, most recently from 830b381 to 44cf2da Compare January 9, 2026 17:55
@ypapadop-amd ypapadop-amd force-pushed the users/ypapadop-amd/aie-queue-throw-exception branch from 44cf2da to fc4c43a Compare January 10, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants