Skip to content
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

Add trt support for BF16 #195

Open
wants to merge 279 commits into
base: main
Choose a base branch
from

Conversation

andompesta
Copy link

This pull request aims to add support for TensortRT integration

Summary of Changes
  1. CLI Support for TensorRT

    • Added a new variable in src/flux/cli.py to enable TensorRT inference.
    • environment variable TRT_ENGINE_DIR specifies the directory for storing TensorRT engines
    • environment variable ONNX_DIRspecifies the directory for ONNX model exports.
    • surrently supports the bf16 (fp16 and fp8 coming soon)
    • supports for model offloading can be added
  2. Modifications for ONNX Export

  3. TensorRT Exporter

    • Added the flux/trt/exporter package, containing code to export PyTorch models to ONNX and build TensorRT engines.
  4. TensorRT Engine Execution

  5. TensorRT Mixin Classes

    • Added the flux/trt/mixin package with mixin classes to share parameters between the model building and inference phases.
  6. TensorRT Manager

    • Introduced flux/trt/trt_manager.py as the main TensorRT management class. It handles the conversion of PyTorch models to TensorRT engines and manages the TensorRT context for inference.

zeke and others added 30 commits August 29, 2024 13:56
* Remove unused import

* Remove extraneous `f` prefix

---------

Co-authored-by: Emil Sadek <[email protected]>
@andompesta andompesta marked this pull request as ready for review November 26, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants