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

Unsupported type in metal PJRT plugin with rng_bit_generator #24867

Open
dmarro89 opened this issue Nov 12, 2024 · 0 comments
Open

Unsupported type in metal PJRT plugin with rng_bit_generator #24867

dmarro89 opened this issue Nov 12, 2024 · 0 comments
Assignees
Labels
Apple GPU (Metal) plugin bug Something isn't working

Comments

@dmarro89
Copy link

dmarro89 commented Nov 12, 2024

Description

Hi all,
When executing an HLO program using the Metal PJRT plugin, the program fails due to an unsupported data type eeturned by the rng_bit_generator operation.

Specifically, the generated HLO includes:

%output_state, %output = "mhlo.rng_bit_generator"(%1) <{rng_algorithm = #mhlo.rng_algorithm<PHILOX>}> : (tensor<3xi64>) -> (tensor<3xi64>, tensor<3xui32>)

The error message indicates that:
Metal only supports MPSDataTypeFloat16, MPSDataTypeBFloat16, MPSDataTypeFloat32, MPSDataTypeInt32, and MPSDataTypeInt64.
The use of ui32 seems to be incompatible with Metal’s allowed types.

I’m trying to understand if the ui32 output is the problem or maybe the use of rng_bit_generator is wrong.
Could you clarify if there is a workaround or planned support for ui32 output in this context? Alternatively, guidance on configuring rng_bit_generator for compatibility with Metal’s supported types would be greatly appreciated.

Thanks

System info (python version, jaxlib version, accelerator, etc.)

jax:    0.4.35
jaxlib: 0.4.35
numpy:  2.1.3
python: 3.13.0 (main, Oct  7 2024, 05:02:14) [Clang 15.0.0 (clang-1500.3.9.4)]
device info: Metal-1, 1 local devices"
process_count: 1
platform: uname_result(system='Darwin', node='MBP-di-Davide.station', release='23.6.0', version='Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030', machine='arm64')
@dmarro89 dmarro89 added the bug Something isn't working label Nov 12, 2024
@dmarro89 dmarro89 changed the title Unsupported Type in Metal PJRT Plugin with rng_bit_generator Unsupported type in metal PJRT plugin with rng_bit_generator Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apple GPU (Metal) plugin bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants