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 3rdparty/tvm-ffi
Submodule tvm-ffi updated 116 files
2 changes: 1 addition & 1 deletion apps/android_rpc/app/src/main/jni/tvm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define TVM_LOG_CUSTOMIZE 1
#define TVM_FFI_USE_LIBBACKTRACE 0

#include "../3rdparty/tvm-ffi/src/ffi/backtrace.cc"
#include "../3rdparty/tvm-ffi/src/ffi/container.cc"
#include "../3rdparty/tvm-ffi/src/ffi/dtype.cc"
#include "../3rdparty/tvm-ffi/src/ffi/error.cc"
Expand All @@ -45,7 +46,6 @@
#include "../3rdparty/tvm-ffi/src/ffi/function.cc"
#include "../3rdparty/tvm-ffi/src/ffi/object.cc"
#include "../3rdparty/tvm-ffi/src/ffi/tensor.cc"
#include "../3rdparty/tvm-ffi/src/ffi/traceback.cc"
#include "../src/runtime/cpu_device_api.cc"
#include "../src/runtime/device_api.cc"
#include "../src/runtime/file_utils.cc"
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/runtime/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class InternalError : public Error {
*/
InternalError(std::string file, int lineno, std::string message)
: Error(DetectKind(message), DetectMessage(message),
TVMFFITraceback(file.c_str(), lineno, "", 0)) {}
TVMFFIBacktrace(file.c_str(), lineno, "", 0)) {}

private:
// try to detect the kind of error from the message when the error type
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/relax/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def main_adjoint(
# return value: (orig_return_values, tuple(adjoints))
return ((lv1, lv2), (x_adjoint, y_adjoint))
"""
if require_grads is not None and not isinstance(require_grads, list):
if require_grads is not None and not isinstance(require_grads, (list, tvm_ffi.Array)):
require_grads = [require_grads]

return _ffi_api.Gradient(func_name, require_grads, target_index) # type: ignore
Expand Down
18 changes: 9 additions & 9 deletions src/target/target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ Any TargetInternal::ParseType(const std::string& str, const TargetKindNode::Valu
result.push_back(parsed);
} catch (const Error& e) {
std::string index = "[" + std::to_string(result.size()) + "]";
throw Error(e.kind(), e.message() + index, e.traceback());
throw Error(e.kind(), e.message() + index, e.backtrace());
}
}
return ffi::Array<ObjectRef>(result);
Expand Down Expand Up @@ -450,7 +450,7 @@ Any TargetInternal::ParseType(const Any& obj, const TargetKindNode::ValueTypeInf
result.push_back(TargetInternal::ParseType(e, *info.key));
} catch (const Error& e) {
std::string index = '[' + std::to_string(result.size()) + ']';
throw Error(e.kind(), index + e.message(), e.traceback());
throw Error(e.kind(), index + e.message(), e.backtrace());
}
}
return ffi::Array<Any>(result);
Expand All @@ -463,14 +463,14 @@ Any TargetInternal::ParseType(const Any& obj, const TargetKindNode::ValueTypeInf
try {
key = TargetInternal::ParseType(kv.first, *info.key);
} catch (const Error& e) {
throw Error(e.kind(), e.message() + ", during parse key of map", e.traceback());
throw Error(e.kind(), e.message() + ", during parse key of map", e.backtrace());
}
try {
val = TargetInternal::ParseType(kv.second, *info.val);
} catch (const Error& e) {
std::ostringstream os;
os << ", during parseing value of map[\"" << key << "\"]";
throw Error(e.kind(), e.message() + os.str(), e.traceback());
throw Error(e.kind(), e.message() + os.str(), e.backtrace());
}
result[key] = val;
}
Expand Down Expand Up @@ -579,7 +579,7 @@ Target::Target(const ffi::String& tag_or_config_or_target_str) {
} catch (const Error& e) {
std::ostringstream os;
os << ". Target creation from string failed: " << tag_or_config_or_target_str;
throw Error("ValueError", e.message() + os.str(), e.traceback());
throw Error("ValueError", e.message() + os.str(), e.backtrace());
}
data_ = std::move(target);
}
Expand All @@ -591,7 +591,7 @@ Target::Target(const ffi::Map<ffi::String, ffi::Any>& config) {
} catch (const Error& e) {
std::ostringstream os;
os << ". Target creation from config dict failed: " << config;
throw Error("ValueError", std::string(e.message()) + os.str(), e.traceback());
throw Error("ValueError", std::string(e.message()) + os.str(), e.backtrace());
}
data_ = std::move(target);
}
Expand Down Expand Up @@ -810,7 +810,7 @@ ObjectPtr<TargetNode> TargetInternal::FromRawString(const ffi::String& target_st
iter += ParseKVPair(RemovePrefixDashes(options[iter]), s_next, &key, &value);
} catch (const Error& e) {
throw Error(e.kind(), e.message() + ", during parsing target `" + target_str + "`",
e.traceback());
e.backtrace());
}
try {
// check if `key` has been used
Expand All @@ -820,7 +820,7 @@ ObjectPtr<TargetNode> TargetInternal::FromRawString(const ffi::String& target_st
config[key] = TargetInternal::ParseType(value, TargetInternal::FindTypeInfo(kind, key));
} catch (const Error& e) {
throw Error(e.kind(), std::string(e.message()) + ", during parsing target[\"" + key + "\"]",
e.traceback());
e.backtrace());
}
}
return TargetInternal::FromConfig(config);
Expand Down Expand Up @@ -927,7 +927,7 @@ ObjectPtr<TargetNode> TargetInternal::FromConfig(ffi::Map<ffi::String, ffi::Any>
attrs[key] = TargetInternal::ParseType(value, info);
} catch (const Error& e) {
throw Error(e.kind(), std::string(e.message()) + ", during parsing target[\"" + key + "\"]",
e.traceback());
e.backtrace());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tir/schedule/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ScheduleError : public tvm::runtime::Error {
public:
/*! \brief Base constructor */
ScheduleError()
: tvm::runtime::Error("ScheduleError", "", TVMFFITraceback(nullptr, 0, nullptr, 0)) {}
: tvm::runtime::Error("ScheduleError", "", TVMFFIBacktrace(nullptr, 0, nullptr, 0)) {}
/*! \brief The error occurred in this IRModule */
virtual IRModule mod() const = 0;
/*! \brief The locations of interest that we want to point out */
Expand Down
2 changes: 1 addition & 1 deletion web/emcc/wasm_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "src/runtime/tensor.cc"
#include "src/runtime/workspace_pool.cc"
// relax setup
#include "3rdparty/tvm-ffi/src/ffi/backtrace.cc"
#include "3rdparty/tvm-ffi/src/ffi/container.cc"
#include "3rdparty/tvm-ffi/src/ffi/dtype.cc"
#include "3rdparty/tvm-ffi/src/ffi/error.cc"
Expand All @@ -58,7 +59,6 @@
#include "3rdparty/tvm-ffi/src/ffi/function.cc"
#include "3rdparty/tvm-ffi/src/ffi/object.cc"
#include "3rdparty/tvm-ffi/src/ffi/tensor.cc"
#include "3rdparty/tvm-ffi/src/ffi/traceback.cc"
#include "src/runtime/memory/memory_manager.cc"
#include "src/runtime/nvtx.cc"
#include "src/runtime/vm/attn_backend.cc"
Expand Down
Loading