Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@justinchuby
Copy link
Member

@justinchuby justinchuby commented Jan 11, 2025

Deprecate all type casting functions because they are mere utilities or reference implementations that should not be directly exposed to users. Users should leverage libraries like ml_dtypes for type conversion.

  • Additionally turned convert_endian and split_complex_to_pairs into private. This is seen as low risk.
  • Added typing_extensions as a dependency. This is a common dependency used by python packages as a polyfill for the typing module.

@justinchuby justinchuby added this to the 1.18 milestone Jan 11, 2025
@codecov
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 84.37500% with 10 lines in your changes missing coverage. Please review.

Project coverage is 57.50%. Comparing base (8275472) to head (390517c).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnx/subbyte.py 86.20% 4 Missing ⚠️
onnx/helper.py 88.00% 3 Missing ⚠️
onnx/numpy_helper.py 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6639      +/-   ##
==========================================
+ Coverage   57.46%   57.50%   +0.03%     
==========================================
  Files         507      507              
  Lines       31584    31624      +40     
  Branches     3046     3046              
==========================================
+ Hits        18151    18185      +34     
- Misses      12607    12613       +6     
  Partials      826      826              

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

@justinchuby justinchuby added the release notes Important changes to call out in release notes label Jan 14, 2025
@justinchuby justinchuby temporarily deployed to testpypi_onnxweekly January 14, 2025 01:06 — with GitHub Actions Inactive
github-merge-queue bot pushed a commit that referenced this pull request Jan 14, 2025
### Description

Refactor `to_array` to simplify and fix conversion logic.

- The `_to_array` function was renamed back to `to_array`, consolidating
with existing logic that leverages custom dtypes.
- Created an unpack_4bit helper to unpack packed 4bit dtype data,
replacing usage of the 4bit->float32 conversion functions because the
original logic was not actually needed.
- Removed test skips because bugs were fixed.
- Type casting functions for custom dtypes will be marked private in the
next PR. Public versions of them will be scheduled for deprecation.
(#6639) Users should use other libraries like ml_dtypes for efficient
type conversion in numpy.

### Motivation and Context

Fix #6604

---------

Signed-off-by: Justin Chu <[email protected]>
@justinchuby justinchuby marked this pull request as ready for review January 14, 2025 19:50
@justinchuby justinchuby requested a review from a team as a code owner January 14, 2025 19:50
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby justinchuby added the run release CIs Use this label to trigger release tests in CI label Jan 14, 2025
@justinchuby justinchuby temporarily deployed to testpypi_onnxweekly January 14, 2025 22:06 — with GitHub Actions Inactive
@justinchuby justinchuby enabled auto-merge January 14, 2025 23:54
Copy link
Contributor

@shubhambhokare1 shubhambhokare1 left a comment

Choose a reason for hiding this comment

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

LGTM

@justinchuby
Copy link
Member Author

@gramalingam for approval. Thanks!

@justinchuby justinchuby added this pull request to the merge queue Jan 22, 2025
Merged via the queue into main with commit bcecb8c Jan 22, 2025
116 of 154 checks passed
@justinchuby justinchuby deleted the justinchu/deprecation branch January 22, 2025 20:11
titaiwangms pushed a commit to titaiwangms/onnx that referenced this pull request Jan 22, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
titaiwangms pushed a commit to titaiwangms/onnx that referenced this pull request Jan 23, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
titaiwangms pushed a commit to titaiwangms/onnx that referenced this pull request Jan 23, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
titaiwangms pushed a commit to titaiwangms/onnx that referenced this pull request Jan 23, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
titaiwangms pushed a commit to titaiwangms/onnx that referenced this pull request Jan 24, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
andife pushed a commit that referenced this pull request Jan 25, 2025
### Description

Refactor `to_array` to simplify and fix conversion logic.

- The `_to_array` function was renamed back to `to_array`, consolidating
with existing logic that leverages custom dtypes.
- Created an unpack_4bit helper to unpack packed 4bit dtype data,
replacing usage of the 4bit->float32 conversion functions because the
original logic was not actually needed.
- Removed test skips because bugs were fixed.
- Type casting functions for custom dtypes will be marked private in the
next PR. Public versions of them will be scheduled for deprecation.
(#6639) Users should use other libraries like ml_dtypes for efficient
type conversion in numpy.

### Motivation and Context

Fix #6604

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Andreas Fehlner <[email protected]>
andife pushed a commit that referenced this pull request Jan 25, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Andreas Fehlner <[email protected]>
seungwoo-ji-03 pushed a commit to seungwoo-ji-03/onnx that referenced this pull request Feb 17, 2025
### Description

Refactor `to_array` to simplify and fix conversion logic.

- The `_to_array` function was renamed back to `to_array`, consolidating
with existing logic that leverages custom dtypes.
- Created an unpack_4bit helper to unpack packed 4bit dtype data,
replacing usage of the 4bit->float32 conversion functions because the
original logic was not actually needed.
- Removed test skips because bugs were fixed.
- Type casting functions for custom dtypes will be marked private in the
next PR. Public versions of them will be scheduled for deprecation.
(onnx#6639) Users should use other libraries like ml_dtypes for efficient
type conversion in numpy.

### Motivation and Context

Fix onnx#6604

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: seungwoo-ji <[email protected]>
seungwoo-ji-03 pushed a commit to seungwoo-ji-03/onnx that referenced this pull request Feb 17, 2025
Deprecate all type casting functions because they are mere utilities or
reference implementations that should not be directly exposed to users.
Users should leverage libraries like `ml_dtypes` for type conversion.

- Additionally turned convert_endian and split_complex_to_pairs into
private. This is seen as low risk.
- Added typing_extensions as a dependency. This is a common dependency
used by python packages as a polyfill for the typing module.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: seungwoo-ji <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: utility Helper modules release notes Important changes to call out in release notes run release CIs Use this label to trigger release tests in CI topic: deprecation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants