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

Chunking quantized model leads to unequal Chunks #353

Closed
nighting0le01 opened this issue Aug 22, 2024 · 2 comments
Closed

Chunking quantized model leads to unequal Chunks #353

nighting0le01 opened this issue Aug 22, 2024 · 2 comments

Comments

@nighting0le01
Copy link

Chunking quantized model leads to unequal Chunks, say we have a ~153 MB model, it's gettting chunked to 153 and 2 kb ,

prog = _load_prog_from_mlmodel(model)

# Compute the incision point by bisecting the program based on weights size
op_idx, first_chunk_weights_size, total_weights_size = _get_op_idx_split_location(
    prog)
print(f"First  chunk size = {first_chunk_weights_size:.2f} MB") # 152.67 MB
print(f"Second chunk size = {total_weights_size - first_chunk_weights_size:.2f} MB") #0.42 MB
print(index=587/2720)
prog_chunk1 = _make_first_chunk_prog(f"index={op_idx}/{len(main_block.operations)") # 587/3000
prog_chunk2 = _make_second_chunk_prog(_load_prog_from_mlmodel(model), op_idx)

how can i chunk model with constant nodes (like in quantization). (might have trouble processing quantized consts)

@aseemw
Copy link
Collaborator

aseemw commented Aug 22, 2024

Chunking script is now being refactored to use coremltools.models.utils.bisect_model() API (#354)

Can you please try again with this coremltools API (coremltools==8.0b2)? And if the issue persists, can you please open an issue in coremltools Github, with the code to reproduce.

@nighting0le01
Copy link
Author

@aseemw thanks i have opened it here:apple/coremltools#2320

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

No branches or pull requests

2 participants