Commit f2e99180 authored by Lei Wang's avatar Lei Wang Committed by LeiWang1999
Browse files

[Refactor] Phaseout LLVM Dependency by Making it Optional (#247)

* remove llvm build

* [Refactor] Update kernel compilation and profiling in examples

- Replaced `tilelang.lower` with `tilelang.compile` in multiple example scripts to streamline kernel compilation.
- Updated profiling calls to utilize the new `get_profiler` method, enhancing performance measurement consistency.
- Adjusted assertions and benchmarking methods to align with the new profiling structure across various examples, ensuring correctness and clarity in performance evaluations.

* lint fix

* License Update

* [Refactor] Improve code formatting and documentation in CUDA header and HIP runtime files

- Adjusted formatting in `cuda.h` for better readability, including alignment of comments and struct fields.
- Cleaned up whitespace and improved comment clarity in `rt_mod_hip.cc` to enhance code maintainability.

* [Refactor] Enhance formatting and clarity in CUDA header and HIP runtime files

- Improved comment alignment and readabilit...
parent 43bd9d3e
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file layout/utils.cc
* \brief Some arith tools for layout & fragment inference
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file layout/utils.h
* \brief Some arith tools for layout & fragment inference
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/bulk_copy.h
* \brief Bulk copy operator.
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/elem.cc
*
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/elem.h
* \brief Define elment-wise operators.
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/gemm.cc
*
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/gemm.h
* \brief Define gemm operator.
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/op.cc
*
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/parallel.h
* \brief Infer layout from ops and parallel for
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/reduce.cc
*
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/op/reduce.h
* \brief Define reduce operator.
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/runtime/runtime.h
* \brief Runtime functions.
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file tl/runtime/runtime.h
* \brief Runtime functions.
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file target/codegen.cc
*/
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file target/codegen.h
* \brief Utility to generate code
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file target/codegen.cc
*/
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*!
* \file target/codegen.h
* \brief Utility to generate code
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/*
* Copyright 1993-2023 NVIDIA Corporation. All rights reserved.
*
......@@ -2230,12 +2228,14 @@ typedef struct CUgraphEdgeData_st {
::CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. */
unsigned char
to_port; /**< This indicates what portion of the downstream node is
dependent on the upstream node or portion thereof (indicated
by \c from_port). The meaning is specific to the node type. A
value of 0 in all cases means the entirety of the downstream
node is dependent on the upstream work. <br> Currently no node
types define non-zero ports. Accordingly, this field must be
set to zero. */
dependent on the upstream node or portion thereof
(indicated by \c from_port). The meaning is
specific to the node type. A value of 0 in all
cases means the entirety of the
downstream node is dependent on the
upstream work. <br> Currently no
node types define non-zero ports. Accordingly,
this field must be set to zero. */
unsigned char type; /**< This should be populated with a value from
::CUgraphDependencyType. (It is typed as char due to
compiler-specific layout of bitfields.) See
......@@ -2499,8 +2499,10 @@ typedef union CUlaunchAttributeValue_union {
::CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. */
int cooperative; /**< Value of launch attribute
::CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a
cooperative kernel (see ::cuLaunchCooperativeKernel). */
CUsynchronizationPolicy syncPolicy; /**< Value of launch attribute
cooperative kernel (see
::cuLaunchCooperativeKernel). */
CUsynchronizationPolicy
syncPolicy; /**< Value of launch attribute
::CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY.
::CUsynchronizationPolicy for work
queued up in this stream */
......@@ -2524,8 +2526,8 @@ typedef union CUlaunchAttributeValue_union {
CUclusterSchedulingPolicy
clusterSchedulingPolicyPreference; /**< Value of launch attribute
::CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE.
Cluster scheduling policy preference
for the kernel. */
Cluster scheduling policy
preference for the kernel. */
int programmaticStreamSerializationAllowed; /**< Value of launch attribute
::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "codegen_cpp.h"
namespace tvm {
......
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "codegen_cuda.h"
#include "runtime/cuda/cuda_module.h"
......@@ -70,7 +67,7 @@ runtime::Module BuildTileLangCUDA(IRModule mod, Target target) {
return runtime::CUDAModuleCreate(ptx, fmt, ExtractFuncInfo(mod), code);
}
String BuildTLDebug(IRModule mod, Target target) {
runtime::Module BuildTileLangCUDAWithoutCompile(IRModule mod, Target target) {
using tvm::runtime::Registry;
bool output_ssa = false;
CodeGenTileLangCUDA cg;
......@@ -90,13 +87,13 @@ String BuildTLDebug(IRModule mod, Target target) {
if (const auto *f = Registry::Get("tilelang_callback_cuda_postproc")) {
code = (*f)(code, target).operator std::string();
}
return String(code);
return runtime::CUDAModuleCreate("ptx", "ptx", ExtractFuncInfo(mod), code);
}
TVM_REGISTER_GLOBAL("target.build.tilelang_cuda")
.set_body_typed(BuildTileLangCUDA);
TVM_REGISTER_GLOBAL("target.build.tl_debug_codegen")
.set_body_typed(BuildTLDebug);
TVM_REGISTER_GLOBAL("target.build.tilelang_cuda_without_compile")
.set_body_typed(BuildTileLangCUDAWithoutCompile);
} // namespace codegen
} // namespace tvm
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment