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

Add FP16 test in Python #203

Merged
merged 5 commits into from
Jun 14, 2023
Merged

Add FP16 test in Python #203

merged 5 commits into from
Jun 14, 2023

Conversation

varunsh-xilinx
Copy link
Member

Summary of Changes

  • Add Python bindings for fp16
  • Fix the return when migraphx worker throws an exception during the run

Closes #201

Motivation

Sending float16 data to the server from Python is important to maintain parity with C++.

Implementation

There was an issue raised in Pybind11 about this issue and a suggested workaround, which I've duplicated here.

Prior to this PR, the MIGraphX worker would crash the server if the worker threw an exception during batch processing. The cause was that that the new_batch was null. Now, this condition is checked for and it returns early. In the base class, I also allowed the return value from the worker to be null. This indicates that there is nothing to pass on to a subsequent worker even if one is configured. This scenario will occur in general when the worker encounters an error though the other workers aren't actively handling this well at the moment.

There are missing Python preprocessing methods for different types as they're being added on an as-needed basis. This also adds fp16 variants to them.

Notes

The preprocessing code was using functions like imagePreprocessFloat() when FP32 was the only type bound. This function has been deprecated. Instead, new code should use imagePreprocessFp32().

Signed-off-by: Varun Sharma <varun.sharma@amd.com>
Signed-off-by: Varun Sharma <varun.sharma@amd.com>
Signed-off-by: Varun Sharma <varun.sharma@amd.com>
Signed-off-by: Varun Sharma <varun.sharma@amd.com>
@varunsh-xilinx varunsh-xilinx linked an issue Jun 14, 2023 that may be closed by this pull request
@gbuildx
Copy link
Collaborator

gbuildx commented Jun 14, 2023

Build successful!

@varunsh-xilinx varunsh-xilinx merged commit 746311c into main Jun 14, 2023
@varunsh-xilinx varunsh-xilinx deleted the 201-fp16-errors-in-python branch June 14, 2023 21:25
@varunsh-xilinx varunsh-xilinx mentioned this pull request Jun 16, 2023
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.

FP16 errors in Python
2 participants