Conversation
878f4b4 to
27703d5
Compare
Signed-off-by: Torch-TensorRT Github Bot <torch-tensorrt.github.bot@nvidia.com>
27703d5 to
ef0662c
Compare
narendasan
left a comment
There was a problem hiding this comment.
Just reviewed the core stuff for now. I think this mostly is not really solving the issue. The core idea is that we want to have a Python implementation of Torchbind endpoints (execute_engine / TRTEngine) that lets us run the same programs with either standard torch-trt or python only rather than just having two implementations that are kind of mixed together
There was a problem hiding this comment.
Its cool that we have this but we should look into if there is a way to drop / mask registrations to change the runtime implementation rather than relying on distinct graph constructions
cc7d4b6 to
5b1bde7
Compare
694755f to
1755001
Compare
| SerializedTensorRTEngineFmt = List[ | ||
| Union[str, bytes] | ||
| ] # Aligned with //core/runtime/register_jit_hooks.cpp | ||
| SerializedTorchTensorRTModuleFmt = Tuple[ |
There was a problem hiding this comment.
This should be with the other serialization info
|
|
||
| engine_info: List[str | bytes] = [""] * SERIALIZATION_LEN | ||
| engine_info[ABI_TARGET_IDX] = torch.ops.tensorrt.ABI_VERSION() | ||
| engine_info[ABI_TARGET_IDX] = ( |
There was a problem hiding this comment.
We should centralize this so its like generate_engine_info and will choose the right source internally
| return ( | ||
| self.name, | ||
| self.engine.__getstate__(), | ||
| engine_info, |
There was a problem hiding this comment.
Does python self.engine not have getstate()?
|
Like why can we use the c++ version of this https://github.com/pytorch/pytorch/blob/e2584b2554d11fda4998a8d2be6145b0eded5049/torch/_library/opaque_object.py#L73 like you do in python and then align the serialization so we dont need the no op |
65d604a to
01f5d13
Compare
| int64_t get_streamable_device_memory_budget(); | ||
| int64_t get_automatic_device_memory_budget(); | ||
| std::vector<at::Tensor> infer_outputs(std::vector<std::vector<int64_t>> input_shapes); | ||
| void set_pre_allocated_outputs(bool enable); |
There was a problem hiding this comment.
This was never used. The setter is here:
| ) | ||
| else: | ||
| metadata = TorchTensorRTModule.decode_metadata( | ||
| fake_trt_engine.get_serialized_metadata() |
There was a problem hiding this comment.
Do we not have this method anymore?
There was a problem hiding this comment.
Can we just call this file _TRTEngine.py
| for i, shape in enumerate(output_shapes) | ||
| ] | ||
|
|
||
| @torch.library.custom_op( # type: ignore[misc] |
There was a problem hiding this comment.
Is this still needed here?
| version_compatible: bool = _defaults.VERSION_COMPATIBLE, | ||
| optimization_level: Optional[int] = _defaults.OPTIMIZATION_LEVEL, | ||
| use_python_runtime: bool = _defaults.USE_PYTHON_RUNTIME, | ||
| use_python_runtime: bool = False, # Does nothing. Kept for backward compatibility. |
There was a problem hiding this comment.
When we detect this is set, throw a deprecation warning
05954a6 to
392fab7
Compare
392fab7 to
bb550df
Compare
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: