Open
Conversation
Add Downcast bound to TensorStorage trait (via downcast-rs) so downstream crates can downcast `dyn TensorStorage` to concrete types. New trait methods: dyn_hash, eq_storage. New Tensor methods: storage_as<T>, try_storage_as<T>, from_storage. Fix Hash, Drop, deep_clone, PartialEq to branch on dense vs non-dense instead of panicking on StorageKind::Other.
PackedMatrixStorage implements TensorStorage and holds Vec<Box<dyn MMMInputValue>> with batch shape/strides. Supports scalar and batched packed matrices. MapOutputAxisToInput::flat_index computes a flat index into PackedMatrixStorage from output coordinates and batch strides, replacing the translate_view pattern for non-dense storage.
Replace all creation sites (6) and access sites (6) to use PackedMatrixStorage instead of Tensor<Opaque> + double-downcast: Creation: PackedFormat::prepare_tensor, OptMatMulPack::do_eval, OptSimpleMatMulPack::eval, LazyIm2Col::eval, Im2Col::eval Access: ProtoFusedSpec::resolve (a+b), resolve_trivial (a+b), QSumB::eval, Gather::eval, panel_extract test Also handle non-dense storage in Tensor::dump and Tensor::is_uniform to prevent panics when formatting or checking uniformity of PackedMatrixStorage-backed tensors.
… impl These impls are no longer needed now that packed matrices use PackedMatrixStorage instead of Opaque wrapping. Also migrate the remaining creation site in PackedBlockQuantFormat::prepare_tensor.
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.
No description provided.