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

Adding implementation for PJRT_Executable_OutputElementTypes and PJRT_Executable_OutputDimensions #238

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

Conversation

sdjukicTT
Copy link
Contributor

Ticket

#164

Problem description

PJRT_Executable_OutputElementTypes and PJRT_Executable_OutputDimensions were unimplemented.

What's changed

In LoadedExecutableInstance::Execute we got the shape for every PJRT_Buffer output from binary.getProgramOutputs and image_->isOutputScalar. Now we store the shape in ExecutableImage class and have a getter for the final shape, and not isOutputScalar.

Adding a vector that stores PJRT_Buffer_Type for every output in ExecutableImage, as well as a getter, for the implementation of PJRT_Executable_OutputElementTypes.

PJRT_Executable_OutputDimensions requires the dimensions to be in a different format. It returns an array of output dimension sizes and an array of concatenated dimensions, so we also store that type of pointer in ExecutableImage. We store it because we are responsible for memory deallocation, and not the caller of PJRT_Executable_OutputDimensions. But because concatenated dimensions are rarely needed, these fields are nullptr until get_output_dims_concatenated is called.

Notes

It is possible that PJRT_Executable_OutputElementTypes should return only different unique PJRT_Buffer_Types, and not a type for every output.

We might want to store information about stride of every output in ExecutableImage as well, so binary.getProgramOutput wouldn't have to be called in LoadedExecutableInstance::Execute, and all the information about outputs would be at one place.

Checklist

  • New/Existing tests provide coverage for changes

Copy link

github-actions bot commented Feb 5, 2025

TestsPassed ✅Skipped ⚠️Failed
TT-XLA Tests599 ran431 passed168 skipped0 failed
TestResult
No test annotations available

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 36.11111% with 23 lines in your changes missing coverage. Please review.

Project coverage is 76.92%. Comparing base (abe6da2) to head (fa67c0a).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/common/pjrt_implementation/executable_image.cc 32.35% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
- Coverage   77.30%   76.92%   -0.39%     
==========================================
  Files          21       21              
  Lines        1018     1053      +35     
==========================================
+ Hits          787      810      +23     
- Misses        231      243      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sdjukicTT sdjukicTT force-pushed the sdjukic/pjrt-output-info-methods branch from ada4db8 to 0c8925c Compare February 20, 2025 16:59
private:
// Checks whether m_output_dim_sizes and m_output_dims_concatenated have been
Copy link
Contributor

Choose a reason for hiding this comment

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

Describe this in a bit more detail, something like: "Check whether the information on output dimension has been populated".

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.

3 participants