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

bf16 support for elementwise operation #3462

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

apbose
Copy link
Collaborator

@apbose apbose commented Apr 2, 2025

#3458 bf16 support for elementwise

@apbose apbose marked this pull request as draft April 2, 2025 16:01
@github-actions github-actions bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Apr 2, 2025
@github-actions github-actions bot requested a review from zewenli98 April 2, 2025 16:02
@apbose apbose force-pushed the bf16_elementwise branch from b1fae21 to 9344de1 Compare April 2, 2025 16:05
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/issue_3458.py	2025-04-02 16:05:16.971503+00:00
+++ /home/runner/work/TensorRT/TensorRT/issue_3458.py	2025-04-02 16:05:38.270778+00:00
@@ -31,6 +31,6 @@
        enabled_precisions={dtype},
        debug=True,
        min_block_size=1,
    )

-print(trt_model(inputs[0]))
\ No newline at end of file
+print(trt_model(inputs[0]))

@apbose apbose force-pushed the bf16_elementwise branch 2 times, most recently from 62c6bbb to 721a0ce Compare April 3, 2025 21:20
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/conversion/impl/elementwise/base.py	2025-04-03 21:20:43.557819+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/conversion/impl/elementwise/base.py	2025-04-03 21:21:04.124037+00:00
@@ -17,10 +17,11 @@
    set_layer_name,
    to_torch,
)
from torch_tensorrt.dynamo.types import TRTElementWiseOp, TRTTensor
import tensorrt as trt
+

def get_python_op_from_trt_elementwise_op(
    trt_op: TRTElementWiseOp,
) -> Callable[[Any, Any], Any]:
    if trt_op == trt.ElementWiseOperation.SUM:

@apbose apbose force-pushed the bf16_elementwise branch from 721a0ce to 414d06e Compare April 4, 2025 00:38
@narendasan
Copy link
Collaborator

@apbose what is the status of this PR?

@apbose apbose marked this pull request as ready for review April 8, 2025 19:17
@apbose
Copy link
Collaborator Author

apbose commented Apr 8, 2025

Passes locally, looks like CI was failing due to CI resource issue. Retriggered the build. Opened the PR for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests needs-release-cherrypick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants