Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph fixes + other stuff #434

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

Graph fixes + other stuff #434

wants to merge 35 commits into from

Conversation

franz
Copy link
Collaborator

@franz franz commented May 10, 2023

  • fixes in the Graph API (unfinished)
  • "native" Graph support (OpenCL command-buffers or LevelZero command-lists)
  • code cleanup in the OpenCL backend
  • support for cl_intel_unified_shared_memory, this removes the need for using SVMMap/Unmap commands on devices that support USM
  • updated some benchmarks

approx 50-60 additional Unit_hipGraph tests pass

franz added 12 commits May 12, 2023 11:00
this is required for cl_khr_command_buffer
This class is used to implement Graphs that execute "natively"
in the backend, using OpenCL command-buffers or LevelZero command-lists
and only synchronizing with the host when required. Fallback to
original Graph is provided in CHIPGraphExec::launch()
* turn CHIPEvent.Refc from pointer to integer,
  move it into CHIPEventLevel0
* disable increaseRefCount/decreaseRefCount for OpenCL,
  the OpenCL runtime already does the refcounting
* remove naked pointers to OpenCL objects, instead
  use the smart pointers from opencl.hpp header
"ctest --timeout 120 -R Unit_hipGraph" with POCL (with
the new cl_pocl_command_buffer_* extensions) reports

59% tests passed, 62 tests failed out of 152

additionally, samples/graph + samples/graphMatrixMultiply
work using the "native graphs" (cl_command_buffer), not
the original chip-spv's graph execution.
Previously, the OpenCL device was checked for fine-grained SVM support,
and if it was unavailable, the backend would assume only coarse-grained
support and insert SVMMap & SVMUnmap for each buffer used by a kernel.

Since Intel OpenCL and PoCL both support the USM extension now, but
don't support fine-grained SVM, this commit helps to avoid the overhead
of the unnecessary Map & Unmap commands.
original code reports Average iteration time
@franz franz force-pushed the graph_opencl branch 2 times, most recently from 5791e64 to 25d2f83 Compare May 12, 2023 11:19
@franz franz marked this pull request as ready for review May 15, 2023 06:55
@franz franz requested a review from pvelesko May 15, 2023 06:55
src/CHIPBackend.cc Outdated Show resolved Hide resolved
src/CHIPBindings.cc Outdated Show resolved Hide resolved
src/CHIPBindings.cc Outdated Show resolved Hide resolved
src/CHIPBindings.cc Outdated Show resolved Hide resolved
src/CHIPBindings.cc Outdated Show resolved Hide resolved
src/CHIPGraph.cc Outdated Show resolved Hide resolved
Comment on lines +55 to +57
// TODO: investigate. Uncommenting this code makes
// a bunch of Unit_hipTexture tests fail with segfault.
/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, resolve this. I think it's fine too to exclude the tests conditionally at the configure time in UnitTests.cmake.

franz and others added 16 commits May 17, 2023 12:44
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
Co-authored-by: Henry Linjamäki <linehill@users.noreply.github.com>
@pvelesko
Copy link
Collaborator

@franz conflicts

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.

3 participants