Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/common/backend_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cuda.h>
#endif

#if defined(__CUDACC__) && CUDA_VERSION >= 11000
#if defined(__CUDACC__) && (CUDA_VERSION >= 11000 || defined(PADDLE_WITH_COREX))
#define PADDLE_CUDA_BF16
#include <cuda_bf16.h>
#endif
Expand Down
3 changes: 2 additions & 1 deletion paddle/utils/flat_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ class sherwood_v3_table : private EntryAlloc, private Hasher, private Equal {

size_t num_buckets_for_reserve(size_t num_elements) const {
return static_cast<size_t>(std::ceil(
num_elements / std::min(0.5, static_cast<double>(_max_load_factor))));
num_elements /
std::min((double)0.5, static_cast<double>(_max_load_factor))));
}
void rehash_for_other_container(const sherwood_v3_table &other) {
rehash(
Expand Down
14 changes: 14 additions & 0 deletions python/paddle/utils/cpp_extension/cpp_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,20 @@ def unix_custom_compile_single_file(
# {'nvcc': {}, 'cxx: {}}
if isinstance(cflags, dict):
cflags = cflags['hipcc']
elif core.is_compiled_with_custom_device("iluvatar_gpu"):
ixcc_cmd = os.path.join(
os.getenv("COREX_HOME", "/usr/local/corex/"),
'bin',
'clang++',
)
if not os.path.isfile(ixcc_cmd):
raise ValueError(
"Corex compiler is unavailable, please set `COREX_HOME` to specify it."
)
self.set_executable('compiler_so', ixcc_cmd)
# {'nvcc': {}, 'cxx: {}}
if isinstance(cflags, dict):
cflags = cflags['nvcc']
else:
assert (
CUDA_HOME is not None
Expand Down
2 changes: 2 additions & 0 deletions python/paddle/utils/cpp_extension/extension_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ def prepare_unix_cudaflags(cflags):
*cflags,
*get_rocm_arch_flags(cflags),
]
elif core.is_compiled_with_custom_device("iluvatar_gpu"):
cflags = [*COMMON_NVCC_FLAGS, '-fPIC', '-DPADDLE_WITH_COREX', *cflags]
else:
cflags = [
*COMMON_NVCC_FLAGS,
Expand Down
Loading