Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMD] remove driver C compilation steps #5228

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

makslevental
Copy link
Contributor

@makslevental makslevental commented Nov 22, 2024

Python can directly call C APIs via ctypes. Since the HIP APIs we use are indeed C APIs, the AMD driver does not need to compile anything (neither the kernel launch trampoline nor the utils).

The added file hip.py is generated from HIP headers using clang2py (and then trimmed down to include only our used APIs).

Note, I've tested this on our mi3002x.

Comment on lines +73 to +74
if launch_enter_hook or launch_exit_hook:
raise NotImplementedError
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Presumably these are actually used somehow? But I couldn't tell from the currently emitted trampoline. Happy to add support for this as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

These hooks are used by proton to record profile scope information.

@makslevental makslevental changed the title [AMD] remove driver compilation steps [AMD] remove driver C compilation steps Nov 22, 2024
Copy link
Contributor

@peterbell10 peterbell10 left a comment

Choose a reason for hiding this comment

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

Have you checked if this impacts launch latency? IIRC ctypes is more for convenience than performance.

Comment on lines +73 to +74
if launch_enter_hook or launch_exit_hook:
raise NotImplementedError
Copy link
Contributor

Choose a reason for hiding this comment

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

These hooks are used by proton to record profile scope information.

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