Skip to content

Commit

Permalink
[RELAX][BYOC] OpenCLML offload support for Relax (#17654)
Browse files Browse the repository at this point in the history
This brings in OpenCLML offloading via BYOC path with available operators in Relax.
Adds codegen tests for Mainline CI.
  • Loading branch information
srkreddy1238 authored Feb 19, 2025
1 parent f4cdb3f commit cc2f079
Show file tree
Hide file tree
Showing 27 changed files with 3,227 additions and 72 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/contrib/CLML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# under the License.

if(USE_CLML)
file(GLOB CLML_RELAY_CONTRIB_SRC src/relay/backend/contrib/clml/*.cc)
file(GLOB CLML_RELAX_CONTRIB_SRC src/relax/backend/contrib/clml/*.cc)
file(GLOB CLML_RUNTIME_MODULE src/runtime/contrib/clml/clml_runtime.cc)
include_directories(SYSTEM "3rdparty/OpenCL-Headers")
list(APPEND COMPILER_SRCS ${CLML_RELAY_CONTRIB_SRC})
list(APPEND COMPILER_SRCS ${CLML_RELAX_CONTRIB_SRC})
if(NOT USE_CLML_GRAPH_EXECUTOR)
list(APPEND COMPILER_SRCS ${CLML_RUNTIME_MODULE})
endif()
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/relax/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
"""Relax backends"""

from . import contrib, cpu_generic, cuda, gpu_generic, metal, rocm
from . import contrib, cpu_generic, cuda, gpu_generic, metal, rocm, adreno
from .dispatch_sampling import DispatchSampling
from .dispatch_sort_scan import DispatchSortScan
from .pattern_registry import get_pattern, get_patterns_with_prefix
24 changes: 24 additions & 0 deletions python/tvm/relax/backend/adreno/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""The Relax Adreno backend compilation pipeline and other passes."""
from .pipeline import (
finalize_passes,
get_default_pipeline,
dataflow_lower_passes,
legalize_passes,
library_dispatch_passes,
)
Loading

0 comments on commit cc2f079

Please sign in to comment.