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

Frozen ThreadState #107

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

DoeringChristian
Copy link
Contributor

@DoeringChristian DoeringChristian commented Oct 23, 2024

This PR implements the Freezing feature in drjit-core (depends on #106).

It makes the following changes:

  • Adds the freezing api to jit.h, including the following functions: jit_freeze_start, jit_freeze_stop, jit_freeze_replay, jit_freeze_dry_run, jit_freeze_pause, jit_freeze_resume, jit_freeze_abort and jit_freeze_destroy as well as the Recording struct.
  • Adds the implementation of the RecordThreadState, a wrapper around either the CUDA or LLVM ThreadState for freezing them.

@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 3 times, most recently from 288194d to bb38a86 Compare October 23, 2024 13:23
@DoeringChristian DoeringChristian marked this pull request as ready for review October 25, 2024 10:58
@DoeringChristian
Copy link
Contributor Author

@merlinND, could you please do a preliminary pass over this PR, to catch some obvious mistakes of mine. Note, this also includes the commit from #106, which I'll remove when that gets merged.

Copy link
Member

@merlinND merlinND left a comment

Choose a reason for hiding this comment

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

Review part 1. It's mostly about documentation / comments / docstrings to make everything super clear.

It's great that you already created unit tests at the drjit-core level!

I still have to look at the big record_ts.* files.

src/init.cpp Outdated Show resolved Hide resolved
tests/vcall.cpp Outdated Show resolved Hide resolved
tests/vcall.cpp Outdated Show resolved Hide resolved
tests/vcall.cpp Outdated Show resolved Hide resolved
tests/vcall.cpp Outdated Show resolved Hide resolved
tests/record.cpp Outdated Show resolved Hide resolved
tests/record.cpp Outdated Show resolved Hide resolved
tests/record.cpp Outdated Show resolved Hide resolved
tests/record.cpp Outdated Show resolved Hide resolved
tests/record.cpp Outdated Show resolved Hide resolved
Copy link
Member

@merlinND merlinND left a comment

Choose a reason for hiding this comment

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

Review part 2

src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 2 times, most recently from 7ea730c to e01f19a Compare November 4, 2024 09:34
Copy link
Member

@merlinND merlinND left a comment

Choose a reason for hiding this comment

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

Review part 3.
It's a partial review of record_ts.cpp, but unfortunately I won't have time to review the rest of the file, there's too much code.

src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
src/record_ts.cpp Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 3 times, most recently from 64a3dd7 to 2915c3d Compare November 7, 2024 12:26
Copy link
Member

@wjakob wjakob left a comment

Choose a reason for hiding this comment

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

Hi Christian,

this is very impressive work! Here is a first batch of feedback, much of it about the structure and comments.

include/drjit-core/jit.h Show resolved Hide resolved
include/drjit-core/jit.h Outdated Show resolved Hide resolved
include/drjit-core/jit.h Outdated Show resolved Hide resolved
include/drjit-core/jit.h Outdated Show resolved Hide resolved
include/drjit-core/jit.h Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Outdated Show resolved Hide resolved
src/record_ts.cpp Show resolved Hide resolved
@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 11 times, most recently from 21a8b62 to e4ca159 Compare November 21, 2024 06:57
src/record_ts.h Outdated Show resolved Hide resolved
@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 4 times, most recently from 05859ad to c4433a4 Compare November 28, 2024 15:12
@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 2 times, most recently from ef227f5 to 4ea393a Compare November 29, 2024 08:54
include/drjit-core/jit.h Outdated Show resolved Hide resolved
src/record_ts.h Outdated Show resolved Hide resolved
@DoeringChristian DoeringChristian force-pushed the frozen-threadstate branch 2 times, most recently from 6473a75 to cfddef6 Compare December 4, 2024 07:28
@DoeringChristian
Copy link
Contributor Author

Squashed everything into 7 commits. The first two are the same as in #106.

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.

3 participants