Skip to content

Commit 49556d7

Browse files
authored
Rename use_tp to use_distributed (#1031)
Summary: use_tp was renamed to use_distributed in #873, but the PR missed generate.py, which caused "AttributeError: 'BuilderArgs' object has no attribute 'use_tp'" when running generate with --profile.
1 parent 8c612dc commit 49556d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

generate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ def __init__(
160160
# global print
161161
# from tp import maybe_init_dist
162162
# rank = maybe_init_dist()
163-
# use_tp = False
163+
# use_distributed = False
164164
self.rank: Optional[int] = None
165-
# if use_tp:
165+
# if use_distributed:
166166
# if rank != 0:
167167
# # only print on rank 0
168168
# print = lambda *args, **kwargs: None
@@ -611,7 +611,7 @@ def chat(
611611
)
612612
if generator_args.compile:
613613
if (
614-
self.is_speculative and self.builder_args.use_tp
614+
self.is_speculative and self.builder_args.use_distributed
615615
): # and ("cuda" in builder_args.device):
616616
torch._inductor.config.triton.cudagraph_trees = (
617617
False # Bug with cudagraph trees in this case
@@ -740,7 +740,7 @@ def callback(x, *, done_generating=False):
740740
)
741741

742742
if (i != generator_args.num_samples - 1 or not self.profile) or (
743-
self.builder_args.use_tp and self.rank != 0
743+
self.builder_args.use_distributed and self.rank != 0
744744
):
745745
import contextlib
746746

@@ -777,7 +777,7 @@ def callback(x, *, done_generating=False):
777777
)
778778
compilation_time = time.perf_counter() - t0
779779
if hasattr(prof, "export_chrome_trace"):
780-
if self.builder_args.use_tp:
780+
if self.builder_args.use_distributed:
781781
prof.export_chrome_trace(f"{self.profile}_rank_{self.rank}.json")
782782
else:
783783
prof.export_chrome_trace(f"{self.profile}.json")

0 commit comments

Comments
 (0)