akaashrp commented on code in PR #20167:
URL: https://github.com/apache/tvm/pull/20167#discussion_r3860052682
##########
web/src/runtime.ts:
##########
@@ -1373,6 +1417,24 @@ export class Instance implements Disposable {
}
}
+ /** Return the exact byte size of a packed BF16 tensor. */
+ private getPackedBF16Bytes(shape: Array<number>): number {
Review Comment:
The C++ check only runs after `storeRawBytes` has copied the packed data
into tensor memory, so it cannot protect that copy. I think the JS check is
needed before the write. Passing the bytes through `ArrayDecodeStorage` would
reintroduce the temporary allocation this path removes. I prefer to keep the
C++ check as validation of the newly exposed FFI entry point itself since it
can be invoked independently of the tensor-cache loader.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]