-
Notifications
You must be signed in to change notification settings - Fork 55
Create Highlevel Bindings for FP8 Datatype #788
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
base: main
Are you sure you want to change the base?
Conversation
|
Automatic reviews are disabled for this repository. |
| from numba.cuda.extending import register_jitable | ||
|
|
||
|
|
||
| @register_jitable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of @register_jittable is recommended by code agents. Is this a good choice in today's Numba?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only makes sense if you want to call the function as a pure Python function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(So register_jitable just makes no sense in the context of Numba-CUDA)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR shows that register_jittable may enable jitting function that's not directly callable in pure python. As shown by
@register_jitable
def bfloat16_to_e8m0(x, saturate, rounding):
return _cvt_bfloat16raw_to_e8m0(
_bfloat16_as_bfloat16_raw(x), saturate, rounding
)Where _bfloat16_as_bfloat16_raw is written as numba intrinsics and may not be called with these arguments as-is.
Proposing updating the docstring of register_jittable and keeping the function.
|
/ok to test 894b79d |
This PR adds high level exposure of fp8 data type to Numba-CUDA.
Supported features include:
Supported FP8 variants (element wise):
Supported packed FP8 variants:
This PR also adds tests for packed type bindings introduced in #686.
closes #200