Skip to content

Commit a0a62f1

Browse files
committed
Lint formatting fixes
1 parent ea51d0d commit a0a62f1

2 files changed

Lines changed: 35 additions & 28 deletions

File tree

backends/cuda/runtime/cuda_backend.cpp

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,11 @@ class ET_EXPERIMENTAL CudaBackend final
210210

211211
// Load constant management symbols (optional — needed for cross-method
212212
// buffer sharing). These are available in torch >= 2.6.
213-
#define LOAD_OPTIONAL_SYMBOL(member, name) \
214-
do { \
215-
auto res = get_function(so_handle, #name); \
216-
handle->member = res.ok() \
217-
? reinterpret_cast<name##Func>(res.get()) \
218-
: nullptr; \
213+
#define LOAD_OPTIONAL_SYMBOL(member, name) \
214+
do { \
215+
auto res = get_function(so_handle, #name); \
216+
handle->member = \
217+
res.ok() ? reinterpret_cast<name##Func>(res.get()) : nullptr; \
219218
} while (0)
220219

221220
LOAD_OPTIONAL_SYMBOL(
@@ -226,8 +225,7 @@ class ET_EXPERIMENTAL CudaBackend final
226225
get_constant_original_fqn,
227226
AOTInductorModelContainerGetConstantOriginalFQN);
228227
LOAD_OPTIONAL_SYMBOL(
229-
extract_constants_map,
230-
AOTInductorModelContainerExtractConstantsMap);
228+
extract_constants_map, AOTInductorModelContainerExtractConstantsMap);
231229
LOAD_OPTIONAL_SYMBOL(
232230
update_user_managed_constant_buffer_pairs,
233231
AOTInductorModelContainerUpdateUserManagedConstantBufferPairs);
@@ -426,8 +424,7 @@ class ET_EXPERIMENTAL CudaBackend final
426424
const char* name = nullptr;
427425
const char* fqn = nullptr;
428426
handle->get_constant_name(handle->container_handle, i, &name);
429-
handle->get_constant_original_fqn(
430-
handle->container_handle, i, &fqn);
427+
handle->get_constant_original_fqn(handle->container_handle, i, &fqn);
431428
if (name && fqn && fqn[0] != '\0') {
432429
fqn_to_name[fqn] = name;
433430
}
@@ -451,11 +448,16 @@ class ET_EXPERIMENTAL CudaBackend final
451448
}
452449
}
453450
constants_extracted_ = true;
454-
ET_LOG(Info, "Extracted %zu shared constants from method '%s'",
455-
shared_constant_tensors_.size(), method_name.c_str());
451+
ET_LOG(
452+
Info,
453+
"Extracted %zu shared constants from method '%s'",
454+
shared_constant_tensors_.size(),
455+
method_name.c_str());
456456
} else {
457-
ET_LOG(Error, "Failed to extract constants from '%s'",
458-
method_name.c_str());
457+
ET_LOG(
458+
Error,
459+
"Failed to extract constants from '%s'",
460+
method_name.c_str());
459461
}
460462
} else {
461463
// Subsequent container: share matching constants from the first.
@@ -470,27 +472,33 @@ class ET_EXPERIMENTAL CudaBackend final
470472
}
471473

472474
if (!pairs.empty()) {
473-
auto update_err =
474-
handle->update_user_managed_constant_buffer_pairs(
475-
handle->container_handle,
476-
pairs.data(),
477-
pairs.size(),
478-
/*use_inactive=*/false,
479-
/*validate_full_update=*/false);
475+
auto update_err = handle->update_user_managed_constant_buffer_pairs(
476+
handle->container_handle,
477+
pairs.data(),
478+
pairs.size(),
479+
/*use_inactive=*/false,
480+
/*validate_full_update=*/false);
480481

481482
if (update_err == Error::Ok) {
482-
ET_LOG(Info, "Shared %zu constants into method '%s'",
483-
pairs.size(), method_name.c_str());
483+
ET_LOG(
484+
Info,
485+
"Shared %zu constants into method '%s'",
486+
pairs.size(),
487+
method_name.c_str());
484488
} else {
485-
ET_LOG(Error, "Failed to share constants into '%s'",
486-
method_name.c_str());
489+
ET_LOG(
490+
Error,
491+
"Failed to share constants into '%s'",
492+
method_name.c_str());
487493
}
488494
}
489495
}
490496
}
491497
} else {
492-
ET_LOG(Info, "Constant sharing APIs not available for method '%s'",
493-
method_name.c_str());
498+
ET_LOG(
499+
Info,
500+
"Constant sharing APIs not available for method '%s'",
501+
method_name.c_str());
494502
}
495503

496504
return (DelegateHandle*)handle; // Return the handle post-processing

examples/models/qwen3_5_moe/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ DEFINE_string(prompt, "Hello", "Prompt text.");
2929
DEFINE_double(temperature, 0.8, "Sampling temperature (0 = greedy).");
3030
DEFINE_int32(max_new_tokens, 128, "Maximum tokens to generate.");
3131

32-
3332
namespace llm = ::executorch::extension::llm;
3433
using ::executorch::extension::from_blob;
3534
using ::executorch::extension::Module;

0 commit comments

Comments
 (0)