mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
pytorch/feature: Record if parallel compile is enabled (#141074)
This gets a bit messy, but this appears to be the best spot to make a true / false decision. Note that since we're looking at whether or not it's used, if the pool doesn't warm up within the time it takes for a compile, we will mark the feature use as false. Pull Request resolved: https://github.com/pytorch/pytorch/pull/141074 Approved by: https://github.com/masnesral ghstack dependencies: #141059
This commit is contained in:
parent
00134d68af
commit
0989871ac9
1 changed files with 7 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ from typing import Any, Callable, Dict, List, Optional, Set, TYPE_CHECKING
|
|||
|
||||
import torch
|
||||
from torch._dynamo.device_interface import get_registered_device_interfaces
|
||||
from torch._dynamo.utils import dynamo_timed
|
||||
from torch._dynamo.utils import dynamo_timed, set_feature_use
|
||||
from torch._inductor import config
|
||||
from torch._inductor.codecache import (
|
||||
CodeCacheFuture,
|
||||
|
|
@ -219,6 +219,9 @@ class AsyncCompile:
|
|||
|
||||
kernel = TritonCodeCache.load(kernel_name, source_code)
|
||||
if self._use_process_pool():
|
||||
set_feature_use(
|
||||
"pytorch/inductor:enable_parallel_compile_version (post_warmup)", True
|
||||
)
|
||||
# We want to support changing these env vars after (and while) the
|
||||
# process pool is running, so pass them to the subprocess to reset.
|
||||
env_vars = ["TORCHINDUCTOR_CACHE_DIR", "TRITON_CACHE_DIR"]
|
||||
|
|
@ -232,6 +235,9 @@ class AsyncCompile:
|
|||
),
|
||||
)
|
||||
else:
|
||||
set_feature_use(
|
||||
"pytorch/inductor:enable_parallel_compile_version (post_warmup)", False
|
||||
)
|
||||
kernel.precompile()
|
||||
return kernel
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue