Commit 5d336a8
Merge autoresearch/network/inference-io-v2: direct storage access for tensor serialization
Bypass candle's data().into_owned() path for CPU contiguous tensors in
RawTensor::from_tensor(). Access CpuStorage variant directly and copy
bytes in a single memcpy instead of flatten_all → to_vec1 → reinterpret.
Key result: raw_tensor_from_tensor benchmark 53% faster (300ns → 141ns).
Combined with v1 optimizations already on main:
- single_op_encode: 126ns → 99ns (21% faster)
- single_op_decode: 191ns → 146ns (24% faster)
- buf_reuse_pipe_roundtrip: 2.1µs → 1.8µs (14% faster)
- raw_tensor_from_tensor(1024): 300ns → 141ns (53% faster)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 file changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
59 | 92 | | |
60 | 93 | | |
61 | 94 | | |
62 | | - | |
63 | 95 | | |
64 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
65 | 112 | | |
66 | 113 | | |
67 | 114 | | |
| |||
0 commit comments