Commit 9776534
committed
review: address feedback on RuntimeCacheHandle pickle changes
- ``RuntimeCacheHandle::serialize``: switch the pending-bytes copy from
``std::memcpy`` to ``std::copy`` (with free-function ``std::cbegin``
/ ``std::cend``), and use free-function ``std::empty`` for the
empty-vector check. Idiomatic C++17 in a hot path that didn't need
the C-string-style API.
- Drop the explanatory comment block above the pending-bytes branch.
- Trim the wrapper ``__getstate__`` docstring: the rationale that named
specific picklability hazards (``weakref``, ``threading.Lock``) is
implementation noise that doesn't belong in the wrapper's contract.
- Drop the cpp-rt skip on
``test_python_handle_pickle_preserves_pending_warm_bytes``. The test
instantiates ``_RuntimeCacheHandle`` directly rather than going
through ``RuntimeCache._handle`` selection, so the python class is
exercisable regardless of which runtime is active. Updated docstring
notes the directness.
Behavior is unchanged. Addresses review comments on
core/runtime/RuntimeSettings.cpp:131, :136 and
tests/py/dynamo/runtime/test_000_runtime_cache.py:341.1 parent 39a5bcd commit 9776534
3 files changed
Lines changed: 10 additions & 16 deletions
File tree
- core/runtime
- py/torch_tensorrt/dynamo/runtime
- tests/py/dynamo/runtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 128 | + | |
133 | 129 | | |
134 | 130 | | |
135 | 131 | | |
136 | | - | |
| 132 | + | |
| 133 | + | |
137 | 134 | | |
138 | 135 | | |
139 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 544 | + | |
548 | 545 | | |
549 | 546 | | |
550 | 547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | 337 | | |
343 | 338 | | |
344 | 339 | | |
345 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
0 commit comments