gp-sdk: fix tensor_fma unsigned operand encoding - #135
Open
AFOliveira wants to merge 1 commit into
Open
Conversation
The tensor_fma helper takes unsigned controls as tenb_unsigned, tena_unsigned, but packed them into the TensorIMA8A32 CSR in the opposite order. This made asymmetric signedness cases set the A/B unsigned bits opposite to the helper contract. Pack tenb_unsigned into UB/bit 22 and tena_unsigned into UA/bit 21, matching the PRM, simulator decode, and hardware behavior. Add a focused GP-SDK host/device test that compares raw CSR encoding against the tensor_fma helper contract across signed/unsigned A and B combinations. Fixes aifoundry-org#132
Member
Author
|
BTW this one was fortunately not an AI jailbreak :) |
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.
Fix the
tensor_fma()unsigned tensor argument encoding sotenb_unsignedmaps to the TensorB unsigned bit andtena_unsignedmaps to the TensorA unsigned bit.The previous helper packed those two controls in the opposite order, which made asymmetric signedness cases behave as if the A/B unsigned arguments were swapped.
Adds a focused test for the raw CSR encoding and the
tensor_fma()helper contract. The launcher is added so the test can set up host/device buffers, copy probe records back, and fail on swapped raw/helper classifications.Tested on the board and simulator.
Fixes #132