neuralmagic / sparsezoo

Neural network model repository for highly sparse and sparse-quantized models with matching sparsification recipes
Apache License 2.0
371 stars 25 forks source link

split_external_data - helper to break ONNX model external data into mutliple files w/ max size #354

Closed bfineran closed 1 year ago

bfineran commented 1 year ago

utility function that breaks ONNX model with a single external data file into multiple external data files with a given max size

internal see doc here: https://github.com/neuralmagic/internal-docs/pull/21

max file size defaults to 16GB

test_plan:

given a plain resnet50 file saved with external data (using sparseml.utils.onnx.save_onnx) saved to model.onnx model.data.onnx)

running split_external_data("model.onnx", 30000000) yielded

model.data.1  model.data.2  model.data.3  model.data.4  model.onnx

model was able to compile and running through deepsparse evaluation gave the expected accuracy

bfineran commented 1 year ago

approved pre rebase