Skip to content

Conversation

ChrisRackauckas
Copy link
Member

Summary

  • Adds detailed CPU information from to system telemetry
  • Provides specific CPU model and speed for better hardware identification
  • Enhances benchmark result analysis with precise hardware details

Details

This PR enhances the system information collection in LinearSolveAutotune by extracting detailed CPU information from Julia's function:

New Information Collected:

  • CPU Model: Specific processor model (e.g., "AMD EPYC 7502 32-Core Processor")
  • CPU Speed: Current CPU speed in MHz
  • Heterogeneous CPU Detection: Identifies systems with mixed CPU types
  • Speed Variations: For systems with varying speeds, tracks average/min/max

Display Updates:

  • GitHub issue comments now show specific CPU model in the header
  • AutotuneResults display includes CPU model and speed
  • System info markdown shows enhanced CPU details

Backward Compatibility:

  • Maintains existing field for compatibility
  • Falls back gracefully when CPU info is unavailable
  • All existing code continues to work unchanged

Example Output

Before:

## Benchmark Results: x86_64 on Linux (2024-01-15 10:30)
- **CPU**: x86_64

After:

## Benchmark Results: AMD EPYC 7502 32-Core Processor on Linux (2024-01-15 10:30)
- **CPU Model**: AMD EPYC 7502 32-Core Processor
- **CPU Speed**: 2500 MHz

Testing

Added test file that verifies:

  • CPU model extraction works correctly
  • CPU speed is properly collected
  • Both get_system_info() and get_detailed_system_info() return consistent data
  • Information is properly formatted for display

Benefits

  • More precise hardware identification in benchmark results
  • Better ability to compare performance across specific CPU models
  • Helps identify performance variations between CPU generations
  • Useful for analyzing MKL vs native BLAS performance on specific processors

- Extract CPU model and speed from Sys.cpu_info()
- Display CPU model instead of generic CPU_NAME where available
- Show CPU speed in MHz for better hardware identification
- Detect heterogeneous CPU configurations
- Calculate average/min/max speeds for systems with varying CPU speeds
- Update telemetry output to show CPU model in GitHub issue comments
- Maintain backward compatibility with existing cpu_name field

This provides more specific hardware information for better benchmark analysis.
first_cpu = cpu_info[1]
info["cpu_model"] = first_cpu.model
info["cpu_speed_mhz"] = first_cpu.speed

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

info["cpu_model"] = "Unknown"
info["cpu_speed_mhz"] = 0
end

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

first_cpu = cpu_info[1]
system_data["cpu_model"] = first_cpu.model
system_data["cpu_speed_mhz"] = first_cpu.speed

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

else
system_data["heterogeneous_cpus"] = false
end

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

# Calculate average CPU speed if speeds vary
cpu_speeds = [cpu.speed for cpu in cpu_info]
if length(unique(cpu_speeds)) > 1
system_data["cpu_speed_avg_mhz"] = round(mean(cpu_speeds), digits=0)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
system_data["cpu_speed_avg_mhz"] = round(mean(cpu_speeds), digits=0)
system_data["cpu_speed_avg_mhz"] = round(mean(cpu_speeds), digits = 0)

system_data["cpu_model"] = "unknown"
system_data["cpu_speed_mhz"] = 0
end

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment on lines 208 to +209
push!(lines, "- **Architecture**: $(get(system_info, "architecture", get(system_info, "arch", "unknown")))")
push!(lines, "- **CPU**: $(get(system_info, "cpu_name", "unknown"))")

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
push!(lines, "- **Architecture**: $(get(system_info, "architecture", get(system_info, "arch", "unknown")))")
push!(lines, "- **CPU**: $(get(system_info, "cpu_name", "unknown"))")
push!(lines,
"- **Architecture**: $(get(system_info, "architecture", get(system_info, "arch", "unknown")))")

# Fallback to legacy CPU name
push!(lines, "- **CPU**: $(get(system_info, "cpu_name", "unknown"))")
end

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

@ChrisRackauckas ChrisRackauckas merged commit 3dd9246 into main Aug 10, 2025
101 of 118 checks passed
@ChrisRackauckas ChrisRackauckas deleted the add-cpu-info-telemetry branch August 10, 2025 01:28
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.

1 participant