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 autocompare #785

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix clang-tidy
  • Loading branch information
NeosZhang committed Apr 19, 2024
commit f2d7ff972cf3f97a9e0a5d9405a35f180ac26811
8 changes: 4 additions & 4 deletions dipu/torch_dipu/csrc_dipu/aten/ops/OpRegexMatch.cpp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑到用户对正则的不熟悉,是否有必要改成 wildcard?

Copy link
Collaborator Author

@NeosZhang NeosZhang Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多数场景下,算子匹配并不会用到很复杂的正则的语法,在readme里面多给几个常用的场景的示例就可以了。
但如果换成wildcard,灵活性会差很多,可能不能满足一些极端场景的需求

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024, DeepLink.

Check notice on line 1 in dipu/torch_dipu/csrc_dipu/aten/ops/OpRegexMatch.cpp

View workflow job for this annotation

GitHub Actions / clang-format

Run clang-format on dipu/torch_dipu/csrc_dipu/aten/ops/OpRegexMatch.cpp

File dipu/torch_dipu/csrc_dipu/aten/ops/OpRegexMatch.cpp does not conform to Custom style guidelines. (lines 106)
#include "OpRegexMatch.hpp"

#include <algorithm>
Expand Down Expand Up @@ -98,13 +98,13 @@
}
} // end of namespace dipu

const char* fallback_env_name = "DIPU_FORCE_FALLBACK_OPS_LIST";
const char* fallback_config_name = ".dipu_force_fallback_op_list.config";
const char* const fallback_env_name = "DIPU_FORCE_FALLBACK_OPS_LIST";
const char* const fallback_config_name = ".dipu_force_fallback_op_list.config";
const std::vector<std::regex> fallbackMatchers =
dipu::loadMatcher(fallback_env_name, fallback_config_name);

const char* specified_autocompare_env_name = "SPECIFIED_AUTOCOMPARE_OPS_LIST";
const char* specified_autocompare_config_name =
const char* const specified_autocompare_env_name = "SPECIFIED_AUTOCOMPARE_OPS_LIST";
const char* const specified_autocompare_config_name =
".specified_autocompare_op_list.config";
const std::vector<std::regex> autocompareMatchers = dipu::loadMatcher(
specified_autocompare_env_name, specified_autocompare_config_name);
8 changes: 4 additions & 4 deletions dipu/torch_dipu/csrc_dipu/aten/ops/OpRegexMatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ bool whetherAutoCompare(const char* opname,
const std::vector<std::regex>& autocompareMatchers);
} // namespace dipu

extern const char* fallback_env_name;
extern const char* fallback_config_name;
extern const char* const fallback_env_name;
extern const char* const fallback_config_name;
extern const std::vector<std::regex> fallbackMatchers;

extern const char* specified_autocompare_env_name;
extern const char* specified_autocompare_config_name;
extern const char* const specified_autocompare_env_name;
extern const char* const specified_autocompare_config_name;
extern const std::vector<std::regex> autocompareMatchers;
Loading