Skip to content

[A2-P] 王琪琦 - Profiling 与性能分析 - #120

Open
Lilyiooo wants to merge 1 commit into
OpenMOSS:mainfrom
Lilyiooo:a2-p/Lilyiooo
Open

[A2-P] 王琪琦 - Profiling 与性能分析#120
Lilyiooo wants to merge 1 commit into
OpenMOSS:mainfrom
Lilyiooo:a2-p/Lilyiooo

Conversation

@Lilyiooo

Copy link
Copy Markdown
Contributor

Summary

  • add the A2-P profiling report and reproducible measurement scripts
  • include end-to-end, torch.profiler, mixed-precision, and memory evidence
  • retain only lightweight, sanitized CSV/JSON/SVG artifacts

Validation

  • targeted A2-P repository validation: passed
  • profiling Python modules compile successfully
  • staged-path, whitespace, and credential-format checks: passed
  • A2-K remains excluded from this branch and PR

@Lilyiooo
Lilyiooo marked this pull request as ready for review July 24, 2026 16:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4b3c5c72e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +53 to +56
peaks.append({"model":"xl","context":ctx,"batch_size":1,"mode":mode,"dtype":"fp32","status":d["status"],"peak_allocated_mib":d.get("peak_allocated_mib"),"peak_reserved_mib":d.get("peak_reserved_mib"),"peak_active_mib":d.get("peak_active_mib","")})
for model,ctx in (("xl",1024),("large",2048)):
d=load(RAW/f"memory/{model}_{ctx}_train.json"); memruns.append(d["config"])
peaks.append({"model":model,"context":ctx,"batch_size":1,"mode":"train_step","dtype":"fp32","status":d["status"],"peak_allocated_mib":d.get("peak_allocated_mib"),"peak_reserved_mib":d.get("peak_reserved_mib"),"peak_active_mib":d.get("peak_active_mib","")})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve OOM failure details in the published summaries

When an OOM occurs (as in all four submitted train-step OOM rows), this summary drops the error_type produced by memory_snapshot.py, and no failure phase is recorded anywhere. Since the raw per-run JSON files are deliberately not submitted, peaks.csv and run_metadata.json leave reviewers unable to determine whether the failure occurred during model construction, forward, backward, or optimizer state allocation; retain at least the exception type and stage in the lightweight outputs.

Useful? React with 👍 / 👎.

rows=sorted(rows,key=lambda r:max(r["cpu_total_us"],r["cuda_total_us"]),reverse=True)
Path(a.table).parent.mkdir(parents=True,exist_ok=True)
with open(a.table,"w",newline="") as f: w=csv.DictWriter(f,fieldnames=rows[0]); w.writeheader(); w.writerows(rows)
write_json(a.output,{"status":"success","config":{"model_size":a.model_size,"context_length":a.context_length,"batch_size":a.batch_size,"warmup":a.warmup,"mode":"train_step","dtype":"fp32","tool":"torch.profiler","trace_file":Path(a.trace).name},"environment":environment(d),"events":rows})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record each profiling command in the run metadata

The six committed profile metadata entries are generated from this config and contain only model/context/settings and a trace filename; they never retain the invocation command (including output/table paths and any execution environment arguments). The README supplies only one medium-1024 example, so the other five published traces cannot be replayed from the committed evidence. Persist sys.argv or an equivalent full command for every profile run.

Useful? React with 👍 / 👎.

@WillQvQ WillQvQ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审核结论:需要修改。

阻塞项:students/王琪琦/assignments/A2-P/submission/profiling/summarize.py 第 19 行的 f-string 无法解析,python3 -m compileallSyntaxError: f-string: expecting '}'。请修复该语法错误,并在原 PR 分支继续提交;其他目录范围、附件大小、结果文件和敏感信息检查未发现阻塞问题。

审核者:GPT-5.6 Sol Ultra

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.

2 participants