Skip to content
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

[async] More fixes of constant folding in async mode #2035

Merged
merged 1 commit into from
Nov 8, 2020

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Nov 8, 2020

This is a follow-up of #2034. Besides the Kernel constructor, running kernel in multiple threads could cause problems on device synchronization (at least on Metal, where metal::KernelManager isn't thread safe).

jit_evaluator_cache_mut also guards the fetch_result call. This is because we have to make sure the content of the global Program's result buffer is not written by two threads, too.

Related issue = #

[Click here for the format server]


@codecov
Copy link

codecov bot commented Nov 8, 2020

Codecov Report

Merging #2035 (5e49f42) into master (980886e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2035   +/-   ##
=======================================
  Coverage   43.54%   43.54%           
=======================================
  Files          45       45           
  Lines        6267     6267           
  Branches     1110     1110           
=======================================
  Hits         2729     2729           
  Misses       3366     3366           
  Partials      172      172           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 980886e...5e49f42. Read the comment docs.

Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Btw, why we have two (*ker)(launch_ctx);? According to the DRY principle, shall we move them (including the mutex guard) into a separate function (like jit_launch_and_fetch_result)?

@yuanming-hu yuanming-hu merged commit 414b0eb into taichi-dev:master Nov 8, 2020
@yuanming-hu yuanming-hu mentioned this pull request Nov 11, 2020
@k-ye k-ye deleted the jit-lock branch December 20, 2020 14:24
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.

4 participants