Skip to content

Conversation

@wrongtest-intellif
Copy link
Contributor

@wrongtest-intellif wrongtest-intellif commented Aug 30, 2024

The change propose to ensure the TargetKind instances to be singleton on serialization.

We encounter the issue when we try to establish distributed tools to accelerate the lowering. Though TargetKind are generally singleton instances for each registered kind, the workload serialization would also create new TargetKind instances (which mostly lay in kTarget func attr).

One simple test workflow is like below:

target = Target("llvm")
mod = tvm.IRModule({"main": func})

# in practice, module dict is collected from many lowerred workloads, with target deserialized.
target2 = tvm.ir.load_json(tvm.ir.save_json(target))
lib = tvm.build({target2: mod}, target_host=target)
lib["func"]()  # oops, no "func" found in the host module.

@wrongtest-intellif wrongtest-intellif marked this pull request as draft August 30, 2024 11:53
@wrongtest-intellif wrongtest-intellif changed the title [Target] Refine equality check on Target and TargetKind instances [Target] Refine equality check on TargetKind instances Aug 31, 2024
@wrongtest-intellif wrongtest-intellif marked this pull request as ready for review September 1, 2024 04:51
@wrongtest-intellif
Copy link
Contributor Author

@tqchen Hi, could you kindly take a look at the change? CI / Windows (pull_request) seems to be broken but I can't find why.

@tqchen tqchen merged commit 42bffc3 into apache:main Sep 3, 2024
@tqchen
Copy link
Member

tqchen commented Sep 3, 2024

thank you @wrongtest-intellif !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants