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

Improve pickle (CandleTensor) conversions to NestedValue #1773

Open
laggui opened this issue May 16, 2024 · 0 comments
Open

Improve pickle (CandleTensor) conversions to NestedValue #1773

laggui opened this issue May 16, 2024 · 0 comments

Comments

@laggui
Copy link
Member

laggui commented May 16, 2024

Follow-up to PR #1751.

Reposting the comment as a new issue.

Instead of serializing CandleTensor, we should just convert the underlying ParamSerde and DataSerialize structures to NestedValue directly. The data (vector) pointer will be copied to NestedValue::F32s or NestedValue::F16s (a new datatype that preserves encoding). You will need to modify the serialize_data function at https://github.com/tracel-ai/burn/blob/main/crates/burn-import/src/pytorch/reader.rs#L127-L145.

You will need to do something similar to the serialize function in https://github.com/tracel-ai/burn/blob/main/crates/burn-import/src/pytorch/adapter.rs#L68-L78. The logic overlaps with converting ParamSerde::new(param_id, DataSerialize::new(data, shape)) to NestedValue.

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

1 participant