python / python/cpython

`_remote_debugging`: `RemoteUnwinder(..., jit=True)`

Đang mở
#149,762 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

extension-modules topic-JIT topic-profiling type-feature
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Feature or enhancement

Proposal:

:)

The idea here is to expose JIT internals a bit more in the Tachyon profiler.

The questions that could be answered trivially:

  • Is JIT actually used? How often?
  • Which executor is hot?
  • What change made the largest difference (diff_flamegraph), in terms of % spent in JIT? Per line?

A bit harder:

  • Which UOPs actually eat time?
  • Which stensils are good?
  • What guards or deopts are bad?
  • What is the trace shape?

The very minimal change that I'm thinking about here is just adding --jit flag (active for --jsonl and maybe for --live but it's a catnip), and adding JitInfo to ThreadInfo.

That's how it could look:

JitInfo(
  executor_id,
  flags
)

This will requires extending debug offsets, obviously.

We could potentially expose native_pc, native_offset, uop_index, exit_index etc. The question would be how to expose metadata for it without balooning JitInfo, and how far we can get without blocking and native unwinding. :)

I'm pretty much open to any other ideas.

There will be definitely some performance impact (more VM reads), but hidden behind the --enable-experimental-jit flag should be bearable, and we could be more playful, going back and forth.

If you think it makes sense, I'd be willing to take a shot, but this will take multiple PRs.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách lần theo _remote_debugging, RemoteUnwinder(..., jit=True) và luồng ThreadInfo hiện có. So sánh hành vi --jit được đề xuất cho --jsonl và có thể là --live, sau đó kiểm tra cách các offset gỡ lỗi được xử lý. Công việc được xem là hoàn tất khi đã xác định rõ phạm vi để cung cấp JitInfo và metadata của nó phía sau --enable-experimental-jit, đồng thời cân nhắc ảnh hưởng đến hiệu năng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
devtools, performance
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.