Skip to content

[JAX] Align and extend docs and examples - #2567

Open
bkowalskiINTEL wants to merge 3 commits into
mainfrom
dev/bkowalsk/jax_align_docs_and_examples
Open

[JAX] Align and extend docs and examples#2567
bkowalskiINTEL wants to merge 3 commits into
mainfrom
dev/bkowalsk/jax_align_docs_and_examples

Conversation

@bkowalskiINTEL

@bkowalskiINTEL bkowalskiINTEL commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Type of Change

documentation

Description

This PR adds more detailed documentation about config serialization and composable configs, and provides config json file examples so that the users can have better understanding of how to create custom ones.
It also adds a small change in vit examples enabling both save_model/load_model and save_to_preset/from_preset APIs.

@bkowalskiINTEL
bkowalskiINTEL force-pushed the dev/bkowalsk/jax_align_docs_and_examples branch from bfd9dec to 6389b7d Compare September 4, 2026 02:09
…on and examples

Signed-off-by: Bartosz Kowalski <bartosz.kowalski@intel.com>
Comment thread docs/source/JAX.md
```python
def quantize_model(
model: keras.Model,
quant_config: BaseConfig,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
quant_config: JaxBaseConfig,

import numpy as np
import tensorflow as tf
from keras.applications.imagenet_utils import decode_predictions
from keras_hub.models import ViTImageClassifier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe better will be to move import ViTImageClassifier to line 40 to show that this import is only required when from_preset is used (?)


from neural_compressor.jax import quantize_model, StaticQuantConfig

from keras_hub.models import ViTImageClassifier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe this import only for line 46 and 76 (?)

print(f"\nLoading quantization configuration from: {args.quant_config_file}")
config = JaxBaseConfig.from_json_file(args.quant_config_file)
else:
print("\nUsing default composable quantization configuration")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
print("\nUsing default composable quantization configuration")
print("\nPreparing composable quantization configuration")

}
}
]
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add just new line at the and to avoid GitHub "-" mark

Comment thread docs/source/JAX.md
- [Introduction](#introduction)
- [Quantization API](#quantization-api)
- [Post-Training Static Quantization](#post-training-static-quantization)
- [Examples](#examples)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update menu

Comment thread docs/source/JAX.md
"""
```

## Quantization configs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure if detailed description of configs should be in this main README. Maybe it could be in config examples

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.

2 participants