-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Unity] Avoid to use std::regex
#16249
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
Conversation
`std::regex` in TVM codebase may cause a symbol conflict with PyTorch, we temporarily disable it before we find a better solution, meanwhile the current usage of `std::regex` is not necessary.
|
let us update the testcase for now(global var patterns) given the regex feature is not freq used yet here |
|
Is there a reproducible test case that can trigger the symbol conflict? I don't see any in this PR, and haven't run into this issue in the past. I have multiple upcoming PRs that use |
|
@Lunderberg this only happens when tvm runs together with PyTorch and in the case of the main examples. Unfortunately it is hard enough to trigger a UT. A rule of thumb is to avoid regex and use exact or prefix match for now. Likely the reason is both tvm and PT depends on some form of regex but there is an C++ ABI issue |
|
Thank you. I haven't been able to reproduce the issue locally, and I want to avoid leaving this open to potential regressions in the future. For the environments where this issue occurs, what is the value of |
|
The previous repro happens when we use ci docker and run a particular test(pytorch frontend qnn ) AFAIK. We will run another unity main test before transition, will keep folks posted. |
|
Thank you. I wonder if it's related to #9362. I'm testing with |
|
This happens when |
|
Strange that the CI didn't run into it as reported in #13156. Edit: Looks like that specific unit test isn't enabled for the unity branch. |
|
Ooh boy, tracking down the CXXABI rabbit hole
|
|
It looks like we can't match TVM's ABI flag to whichever one pytorch uses, because |
|
Hmm. Pytorch's pip index (link) has |
|
Short of requiring users to compile pytorch from source, which I think is too large of a setup burden to require, I don't think there's a good solution until pytorch starts providing wheels with Since the |
|
do we have a strong demand for regex? I feel most of them can be replaced by a callback check, or some more restricted version of prefix matching |
|
I think regexes are a reasonable way to extend user-facing utilities that select a name. Prefix matching assumes that the user has control over the naming scheme in order to provide a common prefix, and callbacks may be more general than desired. I think regex matching is a good middle ground between those two. |
|
I've submitted #16412, a linting rule to raise an error on use |
std::regexin TVM codebase may cause a symbol conflict with PyTorch, we temporarily disable it before we find a better solution, meanwhile the current usage ofstd::regexis not necessary.cc @tqchen