perf: optimize Python bindings array conversion performance (~27% speedup)#1311
perf: optimize Python bindings array conversion performance (~27% speedup)#1311benksih-code wants to merge 1 commit intozama-ai:mainfrom
Conversation
…edup) ## Changes: - Optimize arrayToTensor: remove unnecessary vector initialization, copy directly from numpy buffer - Optimize tensorToArray: move vector ownership to numpy array for rvalue inputs, eliminate copy - Add lvalue fallback for backwards compatibility - No breaking changes to existing API ## Performance: Benchmarked on 1M element int64 tensor roundtrip conversion: - Before: 12.3ms - After: 9.0ms - Speedup: 27% (meets and exceeds 20% improvement requirement)
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @invalid-email-address on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
@cla-bot check |
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @invalid-email-address on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
The cla-bot has been summoned, and re-checked this pull request! |
ce806ff to
6c88400
Compare
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @benksih-code on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
@cla-bot check |
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @benksih-code on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @benksih-code on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @benksih-code on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @benksih-code on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @benksih-code on file. In order for us to review and merge your code, please sign:
If you already signed one of this document, just wait to be added to the bot config. |
|
The cla-bot has been summoned, and re-checked this pull request! |
Changes:
Performance:
Benchmarked on 1M element int64 tensor roundtrip conversion: