Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zq/add specified autocompare2 #794

Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
60eb031
craft
NeosZhang Apr 17, 2024
76d96f6
draft
NeosZhang Apr 18, 2024
63a4ff7
fix
NeosZhang Apr 18, 2024
538cf2f
fix
NeosZhang Apr 18, 2024
5348043
update readme
NeosZhang Apr 19, 2024
6d8a8e3
fix md lint
NeosZhang Apr 19, 2024
4790315
fix cpp lint
NeosZhang Apr 19, 2024
ba73de3
fix readme
NeosZhang Apr 19, 2024
e97db80
fix lint
NeosZhang Apr 19, 2024
8e95f2f
fix
NeosZhang Apr 19, 2024
1ba0e04
rm autcompare CI
NeosZhang Apr 19, 2024
f27200b
add copyright
NeosZhang Apr 19, 2024
e534ce2
fix clang-format
NeosZhang Apr 19, 2024
f2d7ff9
fix clang-tidy
NeosZhang Apr 19, 2024
5598c1b
fix lint
NeosZhang Apr 22, 2024
3c63c9f
Update dipu/QuickStart.md
NeosZhang Apr 22, 2024
5cdba1a
remove ENV USE_GLOBAL_AUTOCOMPARE
NeosZhang Apr 22, 2024
9d9923e
fix
NeosZhang Apr 22, 2024
458233c
fix
NeosZhang Apr 22, 2024
389a267
fix
NeosZhang Apr 23, 2024
c8dbb34
fix readme
NeosZhang Apr 23, 2024
8d40cf9
fix
NeosZhang Apr 24, 2024
d5a38d0
add directMemCopyH2H
NeosZhang Apr 24, 2024
bc8bf8e
ceclear
NeosZhang Apr 25, 2024
ade8db5
reformat func register
NeosZhang Apr 25, 2024
9e18d08
fix clang-format
NeosZhang Apr 25, 2024
e66a97f
fix
NeosZhang Apr 25, 2024
d2b3038
fix
NeosZhang Apr 25, 2024
7061272
fix
NeosZhang Apr 25, 2024
2083444
fix
NeosZhang Apr 25, 2024
9f586ba
test
NeosZhang Apr 25, 2024
c8d9a25
fix
NeosZhang Apr 25, 2024
655332a
fix test_fallback
NeosZhang Apr 26, 2024
87497aa
fix py-lint
NeosZhang Apr 26, 2024
b1cf1f4
fix
NeosZhang Apr 26, 2024
f550add
fix const_var name
NeosZhang Apr 26, 2024
94a4000
fix register macro name, use CUSTOMFALLBACK, instead of FALLBACK"
NeosZhang Apr 26, 2024
f624f36
fix comment
NeosZhang Apr 26, 2024
95ac914
fix
NeosZhang Apr 26, 2024
d575f7f
fix autocompare for _amp_foreach_non_finite_check_and_unscale_
NeosZhang Apr 26, 2024
43e2e84
fix const var name with Google style
NeosZhang Apr 26, 2024
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
Prev Previous commit
Next Next commit
fix
NeosZhang committed Apr 25, 2024

Verified

This commit was signed with the committer’s verified signature.
OS-giulianasilva Giuliana Silva
commit c8d9a25c5d51a6ef419ed8a245ead8478867eaf1
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@
"""

op_no_fallback_with_autocompare_register_template_content = """
NO_FALLBACK_with_AUTOCOMPARE_REGISTER("$register_name", $diopi_fun_name, $aten_fun_name);
NO_FALLBACK_WITH_AUTOCOMPARE_REGISTER("$register_name", $diopi_fun_name, $aten_fun_name);
"""

op_no_fallback_no_autocompare_register_template_content = """
40 changes: 20 additions & 20 deletions dipu/torch_dipu/csrc_dipu/aten/RegisterDIPU.hpp
Original file line number Diff line number Diff line change
@@ -49,27 +49,27 @@ void dipu_fallback(const c10::OperatorHandle& op, DispatchKeySet dispatch_keys,
// It mat be necessary to determine whether to keep torchop default impl
// for non-custom ops through function dipuKeepTorchopDefaultImpl firstly in the
// future, and we use force fallback to keep torchop default impl now.
#define NO_FALLBACK_with_AUTOCOMPARE_REGISTER(opname, diopiFunc, wrapperFunc) \
do { \
if ((reinterpret_cast<void*>(diopiFunc) != nullptr) && \
(!dipu::op_regex_match::isOpMatch( \
opname, dipu::op_regex_match::fallbackMatchers))) { \
if (dipu::op_regex_match::isOpMatch( \
opname, dipu::op_regex_match::autocompareMatchers)) { \
m.impl(opname, TORCH_FN(wrapperFunc##_autocompare)); \
} else { \
m.impl(opname, TORCH_FN(wrapperFunc)); \
} \
} else { \
if ((reinterpret_cast<void*>(diopiFunc) == nullptr)) { \
DIPU_OP_LOG_WARNING_ONCE(#diopiFunc << " is not yet implemented, " \
<< (opname) \
<< " will be fallback to cpu\n"); \
} else { \
DIPU_OP_LOG_WARNING_ONCE("force fallback has been set, " \
#define NO_FALLBACK_WITH_AUTOCOMPARE_REGISTER(opname, diopiFunc, wrapperFunc) \
do { \
if ((reinterpret_cast<void*>(diopiFunc) != nullptr) && \
(!dipu::op_regex_match::isOpMatch( \
opname, dipu::op_regex_match::fallbackMatchers))) { \
if (dipu::op_regex_match::isOpMatch( \
opname, dipu::op_regex_match::autocompareMatchers)) { \
m.impl(opname, TORCH_FN(wrapperFunc##_autocompare)); \
} else { \
m.impl(opname, TORCH_FN(wrapperFunc)); \
} \
} else { \
if ((reinterpret_cast<void*>(diopiFunc) == nullptr)) { \
DIPU_OP_LOG_WARNING_ONCE(#diopiFunc << " is not yet implemented, " \
<< (opname) \
<< " will be fallback to cpu\n"); \
} else { \
DIPU_OP_LOG_WARNING_ONCE("force fallback has been set, " \
<< (opname) << " will be fallback to cpu\n"); \
} \
} \
} \
} \
} while (false);

#define NO_FALLBACK_NO_AUTOCOMPARE_REGISTER(opname, diopiFunc, wrapperFunc) \