Pearu Peterson

Results 177 comments of Pearu Peterson

> For instance, extending dlpack protocol with a read-only flag... dlpack already provides the read-only flag in the new DLManagedTensorVersioned struct: https://dmlc.github.io/dlpack/latest/c_api.html#_CPPv424DLManagedTensorVersioned

Agreed that https://github.com/google/jax/issues/19123 or any user misuse of mutating immutable data can be considered not a real bug when it is documented as undefined behavior. If it is not a...

> > currently torch.from_dlpack throws an exception on immutable (e.g. jax) arrays > I don't think that's the case? Sorry, my bad. It was `torch.asarray` throwing on `__cuda_array_interface__` with read-only...

While we are at (2), it is because (i) the current DLManagedTensor does not have read-only flag and (ii) the view-functionality is required for performance. With DLManagedTensorVersioned, there is a...

> "readonly" is simply a flag at the C level, which should be honored if both producer and consumer support read-only arrays. I think this statement ought to be more...

A related issue is https://github.com/pytorch/pytorch/issues/99404 that suggests looking at the problem from the perspective of creating FakeTensors using the fake tensor converter class.

> Waiting for #120920 (which replaced #120588) @aartbik #120920 has landed

@rgommers @hameerabbasi, please review. The updated proposal resolves many open-ended questions we had previously and the proposal should be complete now.

Just for heads up, I'll respond to review comments shortly. Sorry for the delay!