Skip to content

Conversation

@lslusarczyk
Copy link
Collaborator

fix ext_oneapi_get_state to work with native graph
add empty method to graph that also supports native graphs path

This will resolve two integration issues

non working queue::ext_oneapi_get_state() showing up as:

Traceback (most recent call last):
  File "/home/lslusarczyk/src/pytorch/benchmarks/dynamo/microbenchmarks/xpu/xpu_graph_launch_overhead.py", line 106, in <module>
    main()
    ~~~~^^
  File "/home/lslusarczyk/src/pytorch/benchmarks/dynamo/microbenchmarks/xpu/xpu_graph_launch_overhead.py", line 99, in main
    graph_t = run_xpu_graph(model, x, args.iters, args.fine_grain_itt)
  File "/home/lslusarczyk/src/pytorch/benchmarks/dynamo/microbenchmarks/xpu/xpu_graph_launch_overhead.py", line 65, in run_xpu_graph
    with torch.xpu.graph(g):
         ~~~~~~~~~~~~~~~^^^
  File "/home/lslusarczyk/src/pytorch/torch/xpu/graphs.py", line 198, in __enter__
    self.xpu_graph.capture_begin(*self.pool)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/lslusarczyk/src/pytorch/torch/xpu/graphs.py", line 85, in capture_begin
    super().capture_begin(pool=pool)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
RuntimeError: capture_stream_.queue().ext_oneapi_get_state() == queue_state::recording INTERNAL ASSERT FAILED at "/home/lslusarczyk/src/pytorch/aten/src/ATen/xpu/XPUGraph.cpp":83, please report a bug to PyTorch.

and then not working get_nodes() showing up as

pytorch/torch/xpu/graphs.py:95: UserWarning: The XPU Graph is empty.
This usually means that the graph was attempted to be captured on wrong device or stream.
(Triggered internally at pytorch/aten/src/ATen/xpu/XPUGraph.cpp:106.)
  super().capture_end()

fix ext_oneapi_get_state to work with native graph
add empty method to graph
@adamfidel
Copy link
Collaborator

Thanks for these changes! However, we are in the process of moving forks for development work. This fork has been mirrored to https://github.com/adamfidel/llvm/tree/pablo/graph-native-recording-prototype-v2-rebase and the native recording branch has been migrated. Could you please move this PR there?

@lslusarczyk
Copy link
Collaborator Author

The functionality of this PR has been addressed in adamfidel#1 and adamfidel#3
Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants