-
Notifications
You must be signed in to change notification settings - Fork 753
[XPU] add fetch req log #8070
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
base: develop
Are you sure you want to change the base?
[XPU] add fetch req log #8070
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -981,6 +981,8 @@ def _fetch_request(): | |
| LoggingEventName.ASK_DECODE_RESOURCE_START, task.request_id, getattr(task, "user", "") | ||
| ) | ||
| task.metrics.ask_decode_resource_start_time = time.time() | ||
| if envs.FD_PD_LOG_REQUEST: | ||
| self.llm_logger.info(f"[PD_LOG] P sends Request: {task.to_dict()}") | ||
| while True: | ||
| self.split_connector.send_splitwise_tasks([task], task.idx) | ||
| status, msg = self.split_connector.check_decode_allocated(task) | ||
|
|
@@ -1011,6 +1013,8 @@ def _fetch_request(): | |
| LoggingEventName.ASK_DECODE_RESOURCE_START, task.request_id, getattr(task, "user", "") | ||
| ) | ||
| task.metrics.ask_decode_resource_start_time = time.time() | ||
| if envs.FD_PD_LOG_REQUEST: | ||
| self.llm_logger.info(f"[PD_LOG] P sends Request: {task.to_dict()}") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 安全 这里会把完整用户请求写入 INFO 日志。
建议修复方式: |
||
| self.split_connector.send_splitwise_tasks([task], task.idx) | ||
|
|
||
| for task in tasks: | ||
|
|
@@ -2095,6 +2099,8 @@ def _fetch_requests(): | |
| f"D has received tasks to preallocate resource for tasks: {[task.request_id for task in tasks]}" | ||
| ) | ||
| for task in tasks: | ||
| if envs.FD_PD_LOG_REQUEST: | ||
| self.llm_logger.info(f"[PD_LOG] D received Request: {task.to_dict()}") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 安全 这里会把完整用户请求写入 INFO 日志。
建议修复方式: |
||
| task.metrics.decode_recv_req_time = time.time() | ||
| allocate_resource_requests.extend(tasks) | ||
| elif isinstance(tasks[0], RequestOutput): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 安全 这里会把完整用户请求写入 INFO 日志。
Request.to_dict()包含prompt、prompt_token_ids、messages、system、history、tools、multimodal_data等用户输入字段;一旦FD_PD_LOG_REQUEST=1,PD 请求的原始内容会进入持久化日志,命中仓库 checklist 的日志泄漏项。建议修复方式:
改为专用的脱敏/摘要结构,只输出
request_id、prompt_token_ids_len、idx、num_computed_tokens、必要的 block/resource 元数据;不要调用task.to_dict()直接落日志。