Skip to content

Commit 92d26dc

Browse files
committed
small fixups
1 parent b655990 commit 92d26dc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

third_party/intel/backend/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def make_spv(src, metadata, options):
319319
if os.path.exists(flog.name):
320320
with open(flog.name) as log_file:
321321
log = log_file.read().strip()
322-
if 'spilled' in log:
322+
if 'spilled' in log and metadata["build_flags"].find("-cl-intel-256-GRF-per-thread") is -1:
323323
"""
324324
The exact message is something like:
325325
warning: kernel matmul_kernel compiled SIMD16 allocated 128 regs and spilled around 217

third_party/intel/backend/driver.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ template <typename L0_DEVICE, typename L0_CONTEXT>
108108
std::tuple<ze_module_handle_t, ze_kernel_handle_t, Spills>
109109
compileLevelZeroObjects(uint8_t *binary_ptr, const size_t binary_size,
110110
const std::string &kernel_name, L0_DEVICE l0_device,
111-
L0_CONTEXT l0_context,
112-
const std::string& build_flags, const bool is_spv) {
111+
L0_CONTEXT l0_context, const std::string &build_flags,
112+
const bool is_spv) {
113113
auto l0_module =
114114
checkSyclErrors(create_module(l0_context, l0_device, binary_ptr,
115115
binary_size, build_flags.data(), is_spv));
@@ -137,9 +137,7 @@ struct BuildFlags {
137137

138138
BuildFlags(const char *build_flags) : build_flags_str(build_flags) {}
139139

140-
const std::string& operator()() const {
141-
return build_flags_str;
142-
}
140+
const std::string &operator()() const { return build_flags_str; }
143141

144142
int32_t n_regs() {
145143
if (build_flags_str.find(LARGE_GRF_FLAG) != std::string::npos) {
@@ -164,7 +162,9 @@ struct BuildFlags {
164162
}
165163
}
166164

167-
void addLargeGRFSizeFlag() { build_flags_str = build_flags_str.append(" " + LARGE_GRF_FLAG); }
165+
void addLargeGRFSizeFlag() {
166+
build_flags_str = build_flags_str.append(" " + LARGE_GRF_FLAG);
167+
}
168168
};
169169

170170
static PyObject *loadBinary(PyObject *self, PyObject *args) {
@@ -218,7 +218,7 @@ static PyObject *loadBinary(PyObject *self, PyObject *args) {
218218
// than the threshold, recompile the kernel using large GRF mode.
219219
if (!is_GRF_mode_specified && n_spills > max_reg_spill) {
220220
const std::optional<bool> debugEnabled =
221-
isEnvValueBool(getStrEnv("TRITON_DEBUG"));
221+
isEnvValueBool(getStrEnv("TRITON_DEBUG"));
222222
if (debugEnabled)
223223
std::cout << "(I): Detected " << n_spills
224224
<< " spills, recompiling the kernel using large GRF mode"
@@ -230,12 +230,12 @@ static PyObject *loadBinary(PyObject *self, PyObject *args) {
230230
binary_ptr, binary_size, kernel_name, l0_device, l0_context,
231231
build_flags(), is_spv);
232232

233-
if (debugEnabled)
234-
std::cout << "(I): Kernel has now " << n_spills << " spills"
235-
<< std::endl;
233+
if (debugEnabled)
234+
std::cout << "(I): Kernel has now " << n_spills << " spills"
235+
<< std::endl;
236236
}
237237
}
238-
238+
239239
auto n_regs = build_flags.n_regs();
240240

241241
auto mod = new sycl::kernel_bundle<sycl::bundle_state::executable>(

0 commit comments

Comments
 (0)