Back to Prompt Library
implementation
Implement DeepSeek-R1 Code Analysis and Refactoring
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: PyTorch Optimization Agent
Format
Text-first
Lines
1
Sections
1
Linked challenge
PyTorch Optimization Agent
Prompt source
Original prompt text with formatting preserved for inspection.
1 lines
1 sections
No variables
0 checklist items
Using DeepSeek-R1, implement a core agent capability to analyze a provided PyTorch training loop and identify at least two common performance bottlenecks (e.g., inefficient data loading, CPU-GPU transfer issues, sub-optimal tensor operations). The agent should then propose concrete code changes to address these bottlenecks, providing a clear explanation for each. Focus on leveraging DeepSeek-R1's strengths in code understanding.
Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.