Skip to content

Mark num_outputs as out parameter in PJRT_Executable_OutputDimensions_Args Fixes #25211 #25657

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

grewalsk
Copy link

Fixed #25211 by updating the C API header to explicitly mark num_outputs as an output parameter, clarifying the API contract. I also added a new C API test that calls GetOutputDimensions and verifies that num_outputs, dims and dim_sizes are correctly populated.

…le_OutputDimensions_Args

- Annotate num_outputs in pjrt_c_api.h as /* out */
- Add C API test verifying num_outputs, dims, dim_sizes
Copy link

google-cla bot commented Apr 24, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@grewalsk grewalsk closed this Apr 24, 2025
@grewalsk grewalsk reopened this Apr 24, 2025
@grewalsk grewalsk closed this Apr 24, 2025
@grewalsk grewalsk reopened this Apr 24, 2025
@grewalsk grewalsk closed this Apr 24, 2025
@grewalsk
Copy link
Author

Im having some trouble with the CLA agreement it says an email contributed that, I will fix that and then redo it.

@grewalsk grewalsk reopened this Apr 24, 2025
@golechwierowicz golechwierowicz requested a review from changm April 25, 2025 09:38
@changm changm requested a review from jparkerh April 25, 2025 14:15
Copy link
Contributor

@jparkerh jparkerh left a comment

Choose a reason for hiding this comment

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

One minor comment, otherwise LGTM. Thanks for the PR!

@@ -503,6 +503,59 @@ TEST_F(PjrtCApiTest, PluginAttributes) {
EXPECT_TRUE(names.find("stablehlo_minimum_version") != names.end());
}

TEST_F(PjrtCApiTest, ExecutableOutputDimensions) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In c_api_test_base we have some helper functions to create a compiled executable (i.e. create_executable, l#295). Is it possible to remove some of the boilerplate at the top of test using some of those helpers?

@grewalsk grewalsk force-pushed the fix/issue-25211-num-outputs-out-param branch from 97cd19b to c134a92 Compare May 16, 2025 20:16
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.

num_outputs is not labeled as out parameter in PJRT_Executable_OutputDimensions_Args
2 participants