feat: add TRT 11.0 API compatibility shims#4218
feat: add TRT 11.0 API compatibility shims#4218yizhuoz004 wants to merge 1 commit intopytorch:mainfrom
Conversation
|
Hi @yizhuoz004! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
TRT 11.0 makes strongly-typed mode always-on and removes several weak-typing APIs. Guard all affected call sites with version/feature macros so the build works against both TRT 10.x and TRT 11.0+: - ConversionCtx: use createNetworkV2(0) on TRT 11+ (kEXPLICIT_BATCH removed); gate platformHasFastFp16 / BuilderFlag::kFP16 on ENABLE_FEATURE_WEAK_TYPING - layer_norm: gate setComputePrecision on ENABLE_FEATURE_WEAK_TYPING - unary (sqrt): gate setOutputType on ENABLE_FEATURE_WEAK_TYPING - batch_norm, interpolate, normalize, pooling: getPluginCreator renamed to getCreator (returns IPluginCreatorInterface*) on TRT 11+; dynamic_cast to IPluginCreator* for v1 plugin path - register_plugins: getPluginCreatorList renamed to getAllCreators on TRT 11+ - _TRTInterpreter: catch AttributeError when setting output.dtype (read-only in TRT 11 strongly-typed mode) - MODULE.bazel: switch tensorrt dependency to new_local_repository pointing at local TRT 11 installation; comment out TRT 10 http_archive Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dd250e9 to
61bb401
Compare
|
Do these new apis exist in 10.16 or only 11.0? |
the new API |
|
We should just drop the deprecated types, I think @lanluo-nvidia has done much of this already, but good to know about the new plugin creator |
Description
TRT 11.0 makes strongly-typed mode always-on and removes several weak-typing APIs. Guard all affected call sites with version/feature macros so the build works against both TRT 10.x and TRT 11.0+:
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: