Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/171445
Note: Links to docs will display an error until the docs builds have been completed. ❌ You can merge normally! (7 Unrelated Failures), 1 Unclassified FailureAs of commit b88eddd with merge base fc69434 ( NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following jobs failed, but the AI CI Advisor judged the failures not to be evidence against this change:
UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
jeffdaily
left a comment
There was a problem hiding this comment.
I'd like to understand the design intent before this establishes a public API pattern. A few questions:
-
Semantics on CUDA/ROCm.
is_graph_available()resolves throughhas_graph_impl(device_type), and right now the onlyREGISTER_GRAPH_IMPLin the tree isXPU(aten/src/ATen/xpu/XPUGraph.cpp:270); CUDA/HIP don't register. So on a CUDA or ROCm build this returnsFalsetoday, even though both support graph capture/replay viatorch.cuda.graph/CUDAGraph. The docstring says it reports "whether the current accelerator supports graph capture and replay," which reads as broadly false on those backends. Is the intended meaning narrower, i.e. "is the unifiedtorch.accelerator.Graphfrontend wired up for this backend" rather than "does this device support graphs at all"? If so, could the docstring say that explicitly? And is there a plan to register CUDA/ROCm impls, so the probe doesn't mislead the majority of users in the meantime? -
Redundancy with
Graph().Graph's constructor already doesTORCH_CHECK(has_graph_impl(...))(Graph.cpp:8-11), sotry: torch.accelerator.Graph(); except: ...probes the same registry. What's the motivating case for a separate non-throwingis_graph_available()over that, and is there a concrete caller that needs it? -
Precedent.
torch.acceleratorcurrently exposes onlyis_available()(any accelerator present) andget_device_capability()as capability probes; there's nois_<feature>_available()/supports_<feature>()anywhere in the namespace. Is this intended as the first of a per-feature-probe family, and if so is that a direction the accelerator API owners have signed off on?
|
Hi @jeffdaily, thanks for your message!
Previously, we submitted a PR #171313 to support
I think
I also think each module should provide its own feature detection API. For example, |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack (oldest at bottom):
Motivation
This PR aims to introduce a new API
torch.accelerator.is_graph_availableto detect if the current accelerator supports graph capture and replay feature. This will help the user do something such as: