Repository navigation
feat(coreai_utils): universal assets with deferred weight transforms … - #129
Closed
wangpengmit wants to merge 1 commit into
Closed
wangpengmit wants to merge 1 commit into
wangpengmit wants to merge 1 commit into
Conversation
…(prototype) Universal Asset prototype 2a, not for merge. `make_universal_asset(program, schemes, out)` runs each data-free compression scheme (a coreai-opt function and its kwargs) on a copy of the model and saves that copy as the scheme's direct twin. It then replaces every weight constant that the compression calculated with a `udml.placeholder "uasset.weight_transform"` that reads the fp16 source, at the same position and location, and records the kernel and its resolved parameters in `weight_transforms/<scheme>.json`. The scheme graphs (`@main__<scheme>`) and the fp16 `@main` go into one `universal.aimodel` with one copy of the weights. CoreAI's `coreai-materialize-weight-transforms` pass computes the placeholders at JIT compile time. Testing: Added tests/coreai_utils/test_universal.py (one copy of each weight, a JSON entry for each placeholder, and refilling the placeholders with coreai-opt's values gives the direct twin exactly, for quantize, palettize and sparsify schemes on fp16 and fp32 weights).
wangpengmit
force-pushed
the
dev/wangpengmit/uasset/data-free/aot/1
branch
from
October 8, 2026 21:36
c7d90e7 to
f3a5410
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…(prototype)
Universal Asset prototype 2a, not for merge.
make_universal_asset(program, schemes, out)runs each data-free compression scheme (a coreai-opt function and its kwargs) on a copy of the model and saves that copy as the scheme's direct twin. It then replaces every weight constant that the compression calculated with audml.placeholder "uasset.weight_transform"that reads the fp16 source, at the same position and location, and records the kernel and its resolved parameters inweight_transforms/<scheme>.json. The scheme graphs (@main__<scheme>) and the fp16@maingo into oneuniversal.aimodelwith one copy of the weights. CoreAI'scoreai-materialize-weight-transformspass computes the placeholders at JIT compile time.Testing: Added tests/coreai_utils/test_universal.py (one copy of each weight, a JSON entry for each placeholder, and refilling the placeholders with coreai-opt's values gives the direct twin exactly, for quantize, palettize and sparsify schemes on fp16 and fp32 weights).