Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 6f669c0

Browse files
committed
address review comments
1 parent d8bf8f9 commit 6f669c0

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

docs/source/framework/pytorch_integration/debugging.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ can use these flags to enable logging. Various types of flags exposed are:
1616
* :code:`debug_tuner`: print debug spew for the tuner multithreading behavior.
1717

1818

19-
In order to use enable these flags, you need to call :code:`tc.GlobalDebugInit`
19+
In order to use enable these flags, you need to call :code:`tc.SetDebugFlags`
2020
and set the proper flags to :code:`true`. All of these flags are :code:`boolean`
2121
flags that take values :code:`true` or :code:`false`.
2222

@@ -28,14 +28,14 @@ Example usage
2828
import tensor_comprehensions as tc
2929
import torch
3030
31-
tc.GlobalDebugInit(debug_tc_mapper=True, debug_lang=False)
31+
tc.SetDebugFlags(debug_tc_mapper=True, debug_lang=False)
3232
3333
matmul = tc.define(tc.database['matmul']['lang'], name='matmul')
3434
mat1, mat2 = torch.randn(3, 4).cuda(), torch.randn(4, 5).cuda()
3535
out = matmul(mat1, mat2)
3636
3737
In above example, when the TC executes, we will see the TC mapper information.
38-
You can chose to set any number of flags but the :code:`tc.GlobalDebugInit` should
38+
You can chose to set any number of flags but the :code:`tc.SetDebugFlags` should
3939
only be called once.
4040

4141
Printing TC generated CUDA code
@@ -50,7 +50,7 @@ and the generated CUDA code will be printed on command line.
5050
import tensor_comprehensions as tc
5151
import torch
5252
53-
tc.GlobalDebugInit(dump_cuda=True)
53+
tc.SetDebugFlags(dump_cuda=True)
5454
5555
matmul = tc.define(tc.database['matmul']['lang'], name='matmul')
5656
mat1, mat2 = torch.randn(3, 4).cuda(), torch.randn(4, 5).cuda()

tensor_comprehensions/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from tensor_comprehensions.tc_unit import TcUnit
1919
from tensor_comprehensions.tc_unit import TcAutotuner
2020
from tensor_comprehensions.tc_unit import TcCompilationUnit
21-
from tensor_comprehensions.tc_unit import GlobalDebugInit
21+
from tensor_comprehensions.tc_unit import SetDebugFlags
2222
from tensor_comprehensions.tc_unit import autotuner_settings
2323
from tensor_comprehensions.tc_unit import small_sizes_autotuner_settings
2424
from tensor_comprehensions.tc_unit import ATenCompilationUnit
@@ -27,6 +27,6 @@
2727

2828
__all__ = [
2929
'define', 'TcUnit', 'TcAutotuner', 'TcCompilationUnit', 'autotuner_settings',
30-
'small_sizes_autotuner_settings', 'GlobalDebugInit', 'ATenCompilationUnit',
30+
'small_sizes_autotuner_settings', 'SetDebugFlags', 'ATenCompilationUnit',
3131
'Options', 'database', 'decode',
3232
]

tensor_comprehensions/tc_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
###############################################################################
4242
# Set global debugging flags
4343
###############################################################################
44-
class GlobalDebugInit(object):
44+
class SetDebugFlags(object):
4545
def __init__(self, **kwargs):
4646
self.set_gflags(**kwargs)
4747

test_python/layers/test_dump_cuda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# enable this to dump cuda code generated whenever tc layer runs: simple run or
2323
# autotuner run
24-
tc.GlobalDebugInit(dump_cuda=True)
24+
tc.SetDebugFlags(dump_cuda=True)
2525

2626

2727
class TestDumpCuda(unittest.TestCase):

test_python/layers/test_layernorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import torch.cuda
2020
import unittest
2121

22-
tc.GlobalDebugInit(debug_tuner=False, debug_tc_mapper=False)
22+
tc.SetDebugFlags(debug_tuner=False, debug_tc_mapper=False)
2323

2424

2525
class TestLayerNorm(unittest.TestCase):

test_python/test_debug_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import torch.cuda
2020
import tensor_comprehensions as tc
2121

22-
tc.GlobalDebugInit(dump_cuda=True, debug_tc_mapper=True)
22+
tc.SetDebugFlags(dump_cuda=True, debug_tc_mapper=True)
2323

2424

2525
class TestDebugInit(unittest.TestCase):

test_python/test_tc_torch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from tensor_comprehensions.mapping_options import Options
2525
from common import TestCase, run_tests
2626

27-
tc.GlobalDebugInit(dump_cuda=False)
27+
tc.SetDebugFlags(dump_cuda=False)
2828

2929

3030
MATMUL_LANG = """

0 commit comments

Comments
 (0)