Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Getting Started with AI for VLSI Engineers5
  • Just Enough AI: Models and Context15
  • Prompting13
  • Trust and Verification14
  • Using AI for Engineering Work17
  • Engineering Walkthroughs7
  • Practical Foundations for AI Workflows4
  • Engineering Data5
  • Retrieval-Augmented Generation6
  • Agents and Tool Use18
  • Agent Design8
  • MCP and Skills6
  • Multi-Agent Design6
  • Practical Capstone6
  • Tokens, Cost and Latency12
  • Agentic Workflows for Chip Teams18
    • Regression Triage Agent
    • Lint-and-Fix Loops
    • Guardrails and Human in the Loop
    • Evaluating and Operating Agents
      • Task Success Rate on a Held-Out Set
      • Cost and Latency per Task
      • Regression Suites for Agent Changes
      • Drift, Incident Review, and Shutoff Rules
  • Interview and Judgment10
  • AI Skills: Full Course Index
  • Working with AI Glossary
  • Working with AI Cheatsheet
Loading lesson

‹Evaluating and Operating Agents
  1. Topics
  2. AI Skills for VLSI Engineers
  3. Agentic Workflows for Chip Teams
  4. Evaluating and Operating Agents
  5. Cost and Latency per Task

Reference: Agentic Workflows for Chip Teams · Beginner to Intermediate

Cost and Latency per Task

Cost and latency per attempt and per resolved task, with a worked cost example.

On this page

    Cost per attempt

    Every price below is an EXAMPLE parameter, not a real tariff. Teams plug in their own measured numbers and keep the same arithmetic.

    Token counts also vary by tokenizer and task mix, so they are measured on team traffic. The calc block uses one EXAMPLE triage attempt.

    Line

    EXAMPLE value

    Cost

    Input tokens

    6000 at 3 units per 1M

    6000 x 3 / 10^6 = 0.018 units

    Output tokens

    1500 at 12 units per 1M

    1500 x 12 / 10^6 = 0.018 units

    Total per attempt

    Sum of both lines

    0.018 + 0.018 = 0.036 units

    Cost per resolved task

    Cost per attempt flatters a weak agent, since failed attempts still bill. Cost per resolved task divides total billed spend over all attempts by the number of resolved tasks.

    Human review time usually dominates the token bill. Log review minutes per task beside the token cost so the comparison stays honest.

    plaintext
    1
    2
    3
    4
    5
    6
    7
    8
    EXAMPLE prices: 3 units per 1M input tokens, 12 units per 1M output tokens
    per-attempt tokens (stated EXAMPLE): 6000 in + 1500 out
    cost per attempt = 6000 x 3 / 10^6 + 1500 x 12 / 10^6 = 0.018 + 0.018 = 0.036 units
    valid runs = 200 - 30 invalid = 170
    success rate = 80 / 170 = 8 / 17 = about 0.47
    assuming all 200 attempts incurred the stated cost, total spend = 200 x 0.036 = 7.2 units
    cost per resolved task = 7.2 / 80 = 0.09 units
    conditional valid-case success is 80/170, but it must not erase billed invalid attempts

    Outcome over 200 attempts

    Count

    Share

    Resolved

    80

    40%

    Attempted, check did not pass

    90

    45%

    Invalid setup, excluded

    30

    15%

    Report both 80/200 overall success and 80/170 valid-case success, with exclusion reasons. The table excludes invalid setups from the latter accuracy denominator only. All billed work, including invalid attempts, stays in total spend. If an invalid setup failed before billing, record its actual zero spend instead.

    The program below recomputes the cost numbers from the same EXAMPLE parameters. It uses plain arithmetic, with no model involved.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    import sys
    
    input_tokens = 6000
    output_tokens = 1500
    input_price = 3.0
    output_price = 12.0
    attempts = 200
    invalid = 30
    resolved = 80
    
    cost_attempt = (input_tokens * input_price + output_tokens * output_price) / 1000000.0
    valid = attempts - invalid
    rate = resolved / valid
    total_spend = cost_attempt * attempts
    cost_resolved = total_spend / resolved
    
    if abs(cost_attempt - 0.036) > 1e-9:
        print("FAIL: attempt cost arithmetic off")
        sys.exit(1)
    if valid != 170:
        print("FAIL: valid base arithmetic off")
        sys.exit(1)
    if abs(rate - 80.0 / 170.0) > 1e-12:
        print("FAIL: rate arithmetic off")
        sys.exit(1)
    if abs(cost_resolved - 0.09) > 1e-9:
        print("FAIL: resolved cost arithmetic off")
        sys.exit(1)
    print("PASS: 7.2 units across all attempts; 0.09 units per resolved task; valid-case rate about 0.47")

    Latency and throughput

    Report mean and a high percentile together, since agents have long tails. A mean of 45 s with a p95 of 120 s plans capacity differently than 45 s alone.

    Parallel workers cut wall time but not total cost. 200 tasks at 45 s each need 9000 s of work; 8 workers finish in 1125 s, about 19 min.

    Common mistakes

    Common pitfall

    Quoting cost per attempt while success sits at 0.47 understates the bill by more than half. Quote cost per resolved task, and keep review minutes in the same table.

    Interview

    Likely probes: from attempt cost to resolved cost, and what latency numbers to report.

    • Cost per resolved task includes every billed attempt: 200 x 0.036 / 80 = 0.09 units here.

    • Outcome shares here are 40, 45, and 15 percent, summing to 100.

    • Report mean with p95, and convert worker counts to wall time explicitly.

    Check yourself 200 attempts cost 0.036 units each and 80 resolve. What does each resolved task cost?

    0.09 units: 200 x 0.036 = 7.2 units in total, then 7.2 / 80. Dividing by the valid-case rate (0.036 / 0.47, about 0.077) would hide the 30 billed invalid attempts.

    Check yourself 200 tasks take 45 s each on 8 workers. What is the wall time?

    1125 s, about 19 min. Total work is 9000 s divided by 8 workers.

    Related topics

    • Measuring task success

    • Cost arithmetic

    Previous

    158 / 173

    Next: Regression Suites for Agent Changes

    Up next

    Up nextRegression Suites for Agent Changes

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Drift, Incident Review, and Shutoff Rules