Skip to content

feat(//py): add user level device class in py for embed engine #544

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

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

narendasan
Copy link
Collaborator

Description

Adds a python level Device class so users can set device for apis like embed engine.

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

@github-actions github-actions bot added component: api [Python] Issues re: Python API component: tests Issues re: Tests labels Jul 22, 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.

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

Reformatting /workspace/cpp/ptq/training/vgg16/export_ckpt.py
Reformatting /workspace/cpp/ptq/training/vgg16/vgg16.py
Reformatting /workspace/cpp/ptq/training/vgg16/main.py
Reformatting /workspace/tests/modules/hub.py
Reformatting /workspace/tests/py/test_to_backend_api.py
Reformatting /workspace/tests/py/test_ptq_trt_calibrator.py
Reformatting /workspace/tests/py/test_ptq_dataloader_calibrator.py
--- /workspace/tests/py/test_api.py	(original)
+++ /workspace/tests/py/test_api.py	(reformatted)
@@ -73,6 +73,7 @@
        same = (trt_mod(self.input) - self.scripted_model(self.input)).abs().max()
        self.assertTrue(same < 2e-2)

+
class TestCompileHalf(ModelTestCase):

    def setUp(self):
@@ -94,6 +95,7 @@
        same = (trt_mod(self.input.half()) - self.scripted_model(self.input.half())).abs().max()
        self.assertTrue(same < 2e-2)

+
class TestCompileHalfDefault(ModelTestCase):

    def setUp(self):
@@ -114,6 +116,7 @@
        trt_mod = trtorch.compile(self.scripted_model, compile_spec)
        same = (trt_mod(self.input.half()) - self.scripted_model(self.input.half())).abs().max()
        self.assertTrue(same < 2e-2)
+

class TestFallbackToTorch(ModelTestCase):

Reformatting /workspace/tests/py/test_api_dla.py
Reformatting /workspace/tests/py/test_trt_intercompatability.py
Reformatting /workspace/tests/py/model_test_case.py
Reformatting /workspace/tests/py/test_multi_gpu.py
Reformatting /workspace/tests/py/test_ptq_to_backend.py
Reformatting /workspace/tests/py/test_api.py
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 C++ style guidelines

@narendasan narendasan force-pushed the device_class_py branch 2 times, most recently from 7f4b717 to d99169f Compare July 22, 2021 01:15
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:

Reformatting /workspace/cpp/ptq/training/vgg16/export_ckpt.py
Reformatting /workspace/cpp/ptq/training/vgg16/vgg16.py
Reformatting /workspace/cpp/ptq/training/vgg16/main.py
--- /workspace/tests/py/test_api.py	(original)
+++ /workspace/tests/py/test_api.py	(reformatted)
@@ -73,6 +73,7 @@
        same = (trt_mod(self.input) - self.scripted_model(self.input)).abs().max()
        self.assertTrue(same < 2e-2)

+
class TestCompileHalf(ModelTestCase):

    def setUp(self):
@@ -94,6 +95,7 @@
        same = (trt_mod(self.input.half()) - self.scripted_model(self.input.half())).abs().max()
        self.assertTrue(same < 2e-2)

+
class TestCompileHalfDefault(ModelTestCase):

    def setUp(self):
@@ -114,6 +116,7 @@
        trt_mod = trtorch.compile(self.scripted_model, compile_spec)
        same = (trt_mod(self.input.half()) - self.scripted_model(self.input.half())).abs().max()
        self.assertTrue(same < 2e-2)
+

class TestFallbackToTorch(ModelTestCase):

Reformatting /workspace/tests/modules/hub.py
Reformatting /workspace/tests/py/test_to_backend_api.py
Reformatting /workspace/tests/py/test_api.py
Reformatting /workspace/tests/py/test_api_dla.py
Reformatting /workspace/tests/py/test_trt_intercompatability.py
Reformatting /workspace/tests/py/model_test_case.py
Reformatting /workspace/tests/py/test_multi_gpu.py
Reformatting /workspace/tests/py/test_ptq_to_backend.py
Reformatting /workspace/tests/py/test_ptq_trt_calibrator.py
Reformatting /workspace/tests/py/test_ptq_dataloader_calibrator.py
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 C++ style guidelines

@narendasan narendasan merged commit d38eee7 into input_type Jul 22, 2021
@narendasan narendasan deleted the device_class_py branch July 22, 2021 01:17
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:

Reformatting /workspace/cpp/ptq/training/vgg16/export_ckpt.py
Reformatting /workspace/cpp/ptq/training/vgg16/vgg16.py
Reformatting /workspace/cpp/ptq/training/vgg16/main.py
Reformatting /workspace/tests/py/test_api_dla.py
Reformatting /workspace/tests/py/test_trt_intercompatability.py
Reformatting /workspace/tests/py/model_test_case.py
Reformatting /workspace/tests/py/test_multi_gpu.py
Reformatting /workspace/tests/py/test_ptq_to_backend.py
Reformatting /workspace/tests/py/test_ptq_trt_calibrator.py
Reformatting /workspace/tests/py/test_ptq_dataloader_calibrator.py
--- /workspace/tests/py/test_api.py	(original)
+++ /workspace/tests/py/test_api.py	(reformatted)
@@ -73,6 +73,7 @@
        same = (trt_mod(self.input) - self.scripted_model(self.input)).abs().max()
        self.assertTrue(same < 2e-2)

+
class TestCompileHalf(ModelTestCase):

    def setUp(self):
@@ -94,6 +95,7 @@
        same = (trt_mod(self.input.half()) - self.scripted_model(self.input.half())).abs().max()
        self.assertTrue(same < 2e-2)

+
class TestCompileHalfDefault(ModelTestCase):

    def setUp(self):
@@ -114,6 +116,7 @@
        trt_mod = trtorch.compile(self.scripted_model, compile_spec)
        same = (trt_mod(self.input.half()) - self.scripted_model(self.input.half())).abs().max()
        self.assertTrue(same < 2e-2)
+

class TestFallbackToTorch(ModelTestCase):

Reformatting /workspace/tests/modules/hub.py
Reformatting /workspace/tests/py/test_to_backend_api.py
Reformatting /workspace/tests/py/test_api.py
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 C++ style guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: api [Python] Issues re: Python API component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant