Skip to content

Commit

Permalink
[checkpoint] lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mbs-octoml committed Oct 19, 2021
1 parent 2e7e107 commit 032e63f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion include/tvm/relay/attrs/device_copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ struct DeviceCopyAttrs : public tvm::AttrsNode<DeviceCopyAttrs> {
SEScope src_se_scope = SEScope::FullyUnconstrained();
SEScope dst_se_scope = SEScope::FullyUnconstrained();


TVM_DECLARE_ATTRS(DeviceCopyAttrs, "relay.attrs.DeviceCopyAttrs") {
TVM_ATTR_FIELD(src_se_scope)
.describe("The (virtual) device and scope where the op copies data from.");
Expand Down
4 changes: 2 additions & 2 deletions include/tvm/relay/attrs/on_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ struct OnDeviceAttrs : public tvm::AttrsNode<OnDeviceAttrs> {
bool is_fixed = false;

TVM_DECLARE_ATTRS(OnDeviceAttrs, "relay.attrs.OnDeviceAttrs") {
TVM_ATTR_FIELD(se_scope).describe(
"The (virtual) device and scope holding the expression result.")
TVM_ATTR_FIELD(se_scope)
.describe("The (virtual) device and scope holding the expression result.")
.set_default(SEScope::FullyUnconstrained());
TVM_ATTR_FIELD(is_fixed)
.describe("If true, do not insert a \"device_copy\" call to respect this annotation.")
Expand Down
4 changes: 1 addition & 3 deletions src/relay/backend/graph_plan_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ struct StorageToken {

bool is_valid() const { return !se_scope->is_fully_unconstrained(); }

bool is_compatible(const StorageToken& that) const {
return se_scope == that.se_scope;
}
bool is_compatible(const StorageToken& that) const { return se_scope == that.se_scope; }

std::string ToString() const {
std::ostringstream os;
Expand Down
4 changes: 2 additions & 2 deletions src/relay/backend/te_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ using AnalysisRemapping = std::unordered_map<Expr, Expr, ObjectHash, ObjectEqual
*/
class LowerTensorExprMutator : public DeviceAwareExprMutator {
public:
LowerTensorExprMutator(const IRModule& module, ProcessFn process_fn,
const String& module_name, TECompiler compiler)
LowerTensorExprMutator(const IRModule& module, ProcessFn process_fn, const String& module_name,
TECompiler compiler)
: DeviceAwareExprMutator(module),
module_(module),
process_fn_(process_fn),
Expand Down
3 changes: 1 addition & 2 deletions src/relay/backend/vm/lambda_lift.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ class LambdaLifter : public transform::DeviceAwareExprMutator {
lifted_func =
Function(typed_captured_vars, rebound_body, /*ret_type=*/func->func_type_annotation(),
free_type_vars, /*attrs=*/{}, func->span);
lifted_func =
MaybeFunctionOnDevice(lifted_func, captured_var_se_scopes, result_se_scope);
lifted_func = MaybeFunctionOnDevice(lifted_func, captured_var_se_scopes, result_se_scope);
lifted_func = MarkClosure(lifted_func);
}

Expand Down
6 changes: 3 additions & 3 deletions src/relay/transforms/device_domains.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ SEScope DeviceDomains::SEScopeWithTarget(SEScope se_scope) const {
return target->kind->device_type == device_type;
});
CHECK(itr != targets_.end()) << "The SEScope " << se_scope
<< " does not specify a target, yet no target of device type "
<< device_type << " is in the " << targets_.size()
<< " known targets";
<< " does not specify a target, yet no target of device type "
<< device_type << " is in the " << targets_.size()
<< " known targets";
return SEScope::MakeSEScope(device_type, se_scope->virtual_device_id(), *itr,
se_scope->memory_scope());
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/vm/vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ ObjectRef VirtualMachine::Invoke(const VMFunction& func, const std::vector<Objec
DLOG(INFO) << "Executing Function: " << std::endl << func;
for (int i = 0; i < static_cast<int>(devices_.size()); ++i) {
DLOG(INFO) << "Device " << i << " has device type " << devices_[i].device_type
<< " and device id " << devices_[i].device_id <<
(i == exec_->host_device_index ? " (using as host device)" : "");
<< " and device id " << devices_[i].device_id
<< (i == exec_->host_device_index ? " (using as host device)" : "");
}

InvokeGlobal(func, args);
Expand Down

0 comments on commit 032e63f

Please sign in to comment.