w1049 commented on issue #18018:
URL: https://github.com/apache/tvm/issues/18018#issuecomment-3022872503
In `verify_gpu_code.cc`, errors don't terminate the program but instead
return `false`:
```cpp
try { /* ... */ } catch (const dmlc::Error& e) {
return false;
}
```
Before commit #95d1268, `InternalError` inherited from `::dmlc::Error`:
```cpp
/*!
* \brief Base error type for TVM. Wraps a string message.
*/
class Error : public ::dmlc::Error { // for backwards compatibility
public:
/*!
* \brief Construct an error.
* \param s The message to be displayed with the error.
*/
explicit Error(const std::string& s) : ::dmlc::Error(s) {}
};
/*!
* \brief Error type for errors from CHECK, ICHECK, and LOG(FATAL).
* Contains a backtrace of where it occurred.
*/
class InternalError : public Error {
// ...
};
```
After the commit, the error type changed to `ffi::Error`, which doesn't
inherit from `dmlc::Error`:
```cpp
using ffi::EnvErrorAlreadySet;
using ffi::Error;
/*!
* \brief Error type for errors from CHECK, ICHECK, and LOG(FATAL).
* Contains a backtrace of where it occurred.
*/
class InternalError : public Error {
// ...
};
/*!
* \brief Managed reference to ErrorObj
* \sa Error Object
*/
class Error : public ObjectRef, public std::exception {
// ...
};
```
I believe this is the source of the bug, as the error handling in
`verify_gpu_code.cc` expects `dmlc::Error` but now receives `ffi::Error`.
Modifying the `catch()` block in
`src/meta_schedule/postproc/verify_gpu_code.cc:191` will fix this issue.
Additionally, I've found other parts of the codebase that still depend on
`dmlc::Error`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]