-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable end to end non-DPS testing #289
base: main
Are you sure you want to change the base?
Conversation
406ef76
to
ad0cdfb
Compare
mlir-tensorrt/compiler/lib/Conversion/TensorRTToTensorRTRuntime/TensorRTToTensorRTRuntime.cpp
Outdated
Show resolved
Hide resolved
ad0cdfb
to
fcb0964
Compare
mlir-tensorrt/executor/include/mlir-executor/Runtime/Backend/Lua/LuaRuntime.h
Show resolved
Hide resolved
9fb24dd
to
43d4c93
Compare
7254cbe
to
ac28e6c
Compare
mlir-tensorrt/tensorrt/lib/Target/TensorRTEncodingOpInterface/NetworkEncoder.cpp
Show resolved
Hide resolved
mlir-tensorrt/compiler/lib/Dialect/Plan/Transforms/EliminateShapeOps.cpp
Outdated
Show resolved
Hide resolved
e75953d
to
070359d
Compare
mlir-tensorrt/compiler/lib/Conversion/TensorRTRuntimeToExecutor/TensorRTRuntimeToExecutor.cpp
Outdated
Show resolved
Hide resolved
mlir-tensorrt/compiler/lib/Dialect/Plan/Transforms/EliminateShapeOps.cpp
Outdated
Show resolved
Hide resolved
070359d
to
d839011
Compare
mlir-tensorrt/test/Conversion/TensorRTRuntimeToExecutor/tensorrt-runtime-to-executor.mlir
Outdated
Show resolved
Hide resolved
mlir-tensorrt/test/Conversion/TensorRTRuntimeToExecutor/tensorrt-runtime-to-executor.mlir
Outdated
Show resolved
Hide resolved
@@ -53,7 +53,7 @@ extern "C" { | |||
/// caller must be sure to delete errors via mtrtStatusDestroy. | |||
//===----------------------------------------------------------------------===// | |||
|
|||
typedef struct MTRT_RuntimeClient MTRT_Runtimeclient; | |||
struct MTRT_RuntimeClient; // Forward declaration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a C header, not C++.
Without the typedef, we would fail to compile when including this header in a C library (e.g. we would need to rename all the types below to struct MTRT_RuntimeClient
instead of just MTRT_RuntimeClient
. The typedef
is a requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea why we use MTRT_Runtimeclient
instead of MTRT_RuntimeClient
? Is it just a typo?
mlir-tensorrt/compiler/lib/Dialect/Plan/Transforms/OutlineClusters.cpp
Outdated
Show resolved
Hide resolved
mlir-tensorrt/executor/include/mlir-executor-c/Runtime/Runtime.h
Outdated
Show resolved
Hide resolved
|
||
results.push_back(std::move(*memref)); | ||
(*client)->getAllocTracker().incrementExternalCount((*memRef)->getMemory()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this violates an invariant that we should be enforcing -- external reference count should be 0 for any "externally managed" pointer. Reference counts are only required for the object that owns the resource (which in this case is the sesssion).
I've been meaning to erase the distinction between client/session trackers and just have RuntimeSession use the Client's tracker. But until we do that, what we need here actually is to "release" the pointer from the session ownership and have the client assume ownership.
Overall, looks good except for minor comments. Great to see it working end-to-end, and of course much kudos to you for getting this working! |
2ee6ed3
to
eed9be4
Compare
Implement python binding changes to allow execute function return multiple returns. Update tests to use non-DPS style calling convention. Also, enable end to end lowering by enabling conversion of closed alloc group op to tensorrt dialect. Miscellaneous fixes: 1. Add missing handling of `CallAllocOp` in EliminateShapeOps pass. 2. Skip non ranked tensor type function arguments while collecting host tensor arguments. 3. Temporarily add a pass to remove clone operation in MemRefToExecutor dialect conversion. 4. Relax memref creation for empty shape tensors. 5. Fix memref life returned from Lua function results. This required session allocator to track returned memref. Also, address Fix incorrect indexing into output memref results Return error status instead of silently erroring out during TensorRT weight conversion Address review comments
eed9be4
to
6e647ca
Compare
@@ -650,9 +650,6 @@ parseResults(const sol::protected_function_result &pfr, | |||
if (!memref.isOk()) | |||
return memref.getStatus(); | |||
|
|||
// Increment external reference count since we are returning a memref | |||
allocator.incrementExternalCount(info.ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need this. Reference count should only be incremented if a explicitly create a DL pack tensor on a memref.
Here memref is internally owned and tracked.
7b25b15
to
9334481
Compare
9334481
to
8710d9a
Compare
@christopherbate were you able to merge changes from this PR? |
Implement python binding changes to allow execute function return
multiple returns. Update tests to use non-DPS style calling convention.
Also, enable end to end lowering by enabling conversion of closed alloc group op to tensorrt dialect.
Miscellaneous fixes:
CallAllocOp
in EliminateShapeOps pass.