Skip to content

Conversation

narendasan
Copy link
Collaborator

@narendasan narendasan commented Feb 9, 2021

Description

On Ampere TF32 is the default FP32 format. This PR adds support to disable TF32 and use the standard FP32 format.

Fixes #247

Type of change

Please delete options that are not relevant and/or add your own.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes

Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: api [C++] Issues re: C++ API component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: tests Issues re: Tests labels Feb 9, 2021
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.

Code conforms to Python style guidelines

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.

Code conforms to Python style guidelines

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 C++ style guidelines:

diff --git a/workspace/cpp/trtorchc/main.cpp b/tmp/changes.txt
index 61cc4f9..93dbe33 100644
--- a/workspace/cpp/trtorchc/main.cpp
+++ b/tmp/changes.txt
@@ -164,10 +164,7 @@ int main(int argc, char** argv) {
      {"allow-gpu-fallback"});

  args::Flag disable_tf32(
-      parser,
-      "disable-tf32",
-      "Prevent Float32 layers from using the TF32 data format",
-      {"disable-tf32"});
+      parser, "disable-tf32", "Prevent Float32 layers from using the TF32 data format", {"disable-tf32"});

  args::ValueFlag<std::string> op_precision(
      parser,
ERROR: Some files do not conform to style guidelines

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 C++ style guidelines:

diff --git a/workspace/cpp/trtorchc/main.cpp b/tmp/changes.txt
index 61cc4f9..93dbe33 100644
--- a/workspace/cpp/trtorchc/main.cpp
+++ b/tmp/changes.txt
@@ -164,10 +164,7 @@ int main(int argc, char** argv) {
      {"allow-gpu-fallback"});

  args::Flag disable_tf32(
-      parser,
-      "disable-tf32",
-      "Prevent Float32 layers from using the TF32 data format",
-      {"disable-tf32"});
+      parser, "disable-tf32", "Prevent Float32 layers from using the TF32 data format", {"disable-tf32"});

  args::ValueFlag<std::string> op_precision(
      parser,
ERROR: Some files do not conform to style guidelines

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 C++ style guidelines:

diff --git a/workspace/cpp/trtorchc/main.cpp b/tmp/changes.txt
index 61cc4f9..93dbe33 100644
--- a/workspace/cpp/trtorchc/main.cpp
+++ b/tmp/changes.txt
@@ -164,10 +164,7 @@ int main(int argc, char** argv) {
      {"allow-gpu-fallback"});

  args::Flag disable_tf32(
-      parser,
-      "disable-tf32",
-      "Prevent Float32 layers from using the TF32 data format",
-      {"disable-tf32"});
+      parser, "disable-tf32", "Prevent Float32 layers from using the TF32 data format", {"disable-tf32"});

  args::ValueFlag<std::string> op_precision(
      parser,
ERROR: Some files do not conform to style guidelines

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.

Code conforms to Python style guidelines

@peri044
Copy link
Collaborator

peri044 commented Feb 9, 2021

LGTM

Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
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.

Code conforms to C++ style guidelines

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.

Code conforms to Python style guidelines

@narendasan narendasan merged commit be080a9 into master Feb 9, 2021
@narendasan narendasan deleted the disable_tf32 branch February 9, 2021 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: api [C++] Issues re: C++ API component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨[Feature] Add API to disable TF32 in TRTorch
2 participants