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

Support tfjs converter options in JAX conversion #7331

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

mattsoulanille
Copy link
Member

@mattsoulanille mattsoulanille commented Jan 31, 2023

Support configuring the options, such as quantization, passed to tfjs converter during conversion of a jax model.

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

This allows configuring the options passed to tfjs converter during conversion
of a jax model, such as quantization.
@@ -60,7 +60,8 @@ def convert_jax(
*,
input_signatures: Sequence[Tuple[Sequence[Union[int, None]], DType]],
model_dir: str,
polymorphic_shapes: Optional[Sequence[Union[str, PolyShape]]] = None):
polymorphic_shapes: Optional[Sequence[Union[str, PolyShape]]] = None,
**tfjs_converter_params):
Copy link
Member Author

@mattsoulanille mattsoulanille Jan 31, 2023

Choose a reason for hiding this comment

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

I'm not sure if we should grab the remaining arguments with ** or have the user pass a dictionary of TFJS converter arguments here. What do reviewers think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The former is more pythonic.

@mattsoulanille mattsoulanille marked this pull request as ready for review January 31, 2023 23:01
@mattsoulanille mattsoulanille changed the title Pass extra jax conversion options to tfjs converter Support tfjs converter options in JAX conversion Jan 31, 2023
@mattsoulanille
Copy link
Member Author

mattsoulanille commented Jan 31, 2023

Fixes #7330

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @chunnienc and @mattsoulanille)


tfjs-converter/python/tensorflowjs/converters/jax_conversion.py line 64 at r1 (raw file):

Previously, chunnienc wrote…

The former is more pythonic.

thanks, it will be good to update the doc for the extra params

Copy link
Member Author

@mattsoulanille mattsoulanille left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 2 of 1 approvals obtained (waiting on @chunnienc and @pyu10055)


tfjs-converter/python/tensorflowjs/converters/jax_conversion.py line 64 at r1 (raw file):

Previously, pyu10055 (Ping Yu) wrote…

thanks, it will be good to update the doc for the extra params

good point. Done.

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 2 of 1 approvals obtained (waiting on @chunnienc)

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