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

[scratch] Scratch PR for backporting the allocations profiler to julia 1.7 (we're targeting this branch in our build at RelationalAI) #44119

Closed
wants to merge 5 commits into from

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Feb 10, 2022

Scratch PR for backporting the allocations profiler to julia 1.6 julia 1.7 (we're applying this PR as a patch in our build at RelationalAI).

I know that this can't be backported, since it's a Feature, not a bug-fix / performance improvement, but we're backporting it for our internal builds, and so i wanted to open the draft PR here so we can coordinate on it and make sure we did the backport correctly 😊

Backports:

@NHDaly NHDaly force-pushed the nhd-1.6-backport-allocs-profiler branch from da0171e to fa03f38 Compare February 10, 2022 20:49
@vchuravy vchuravy added the status:DO NOT MERGE Do not merge this PR! label Feb 10, 2022
@NHDaly
Copy link
Member Author

NHDaly commented Feb 10, 2022

oh nice, thanks @vchuravy , i was wondering if there was a way to mark that. Thank you!

NHDaly and others added 5 commits April 5, 2022 09:49
…cations Profiler (#44043)

* Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler

Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to
allow us to instrument it in the Allocations Profiler.

Followup to #43868

Finishes fixing #43688 (gets the stacks, though not the types, of big allocs).

-----

- Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined
- add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner
    - replace all internal calls to jl_gc_big_alloc to call this instead
- add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner
    - This one is instrumented, and is meant to be called by generated
      code.

Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
…-thread backtrace buffer in ptls (#44116)

* Fix thread-safety violation in Allocations Profiler:

Re-use the shared `ptls->bt_data` buffer from the thread-local storage
for the buffer, to ensure that each thread has a separate buffer.

This buffer is shared with the exception throwing mechanism, but is safe
to share since julia exception throwing never interleaves with
allocations profiling.

* Approach two: Create a separate per-thread allocations backtrace buffer.

* Update src/gc-alloc-profiler.cpp

Co-authored-by: Jameson Nash <vtjnash@gmail.com>

* Update src/gc-alloc-profiler.cpp

Co-authored-by: Jameson Nash <vtjnash@gmail.com>

* fix type error (#44235)

* Update src/gc-alloc-profiler.cpp

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
@NHDaly NHDaly force-pushed the nhd-1.6-backport-allocs-profiler branch from 22bb755 to a690e38 Compare April 5, 2022 13:49
@NHDaly NHDaly changed the base branch from release-1.6 to release-1.7 April 5, 2022 13:49
@NHDaly NHDaly changed the title [scratch] Scratch PR for backporting the allocations profiler to julia 1.6 (we're targeting this branch in our build at RelationalAI) [scratch] Scratch PR for backporting the allocations profiler to julia 1.7 (we're targeting this branch in our build at RelationalAI) Apr 5, 2022
@NHDaly
Copy link
Member Author

NHDaly commented Apr 5, 2022

Updated the branch to rebase on top of 1.7 instead. (For posterity: the commit for the old branch against 1.6 was 22bb755.)

@NHDaly NHDaly closed this May 12, 2022
@giordano giordano deleted the nhd-1.6-backport-allocs-profiler branch June 7, 2022 19:21
@DilumAluthge DilumAluthge removed the status:DO NOT MERGE Do not merge this PR! label Jul 6, 2022
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