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

Draft
wants to merge 232 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.

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.

2 participants