Skip to content

Merge from GO #455

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

Merged
merged 29 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4b389f3
Added option to skip detect-sudo, support postfix detection
amd-arsuresh May 29, 2025
dc76ec1
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] May 29, 2025
ffc4e25
Support installation variations in get,llvm
amd-arsuresh Jun 2, 2025
fc772a2
Merge branch 'mlcommons:dev' into dev
arjunsuresh Jun 2, 2025
988924a
Fix tags for nvidia-harness
arjunsuresh Jun 2, 2025
061bf60
Support tar.bz2, 7z and rar in extract-file, export more variables in…
amd-arsuresh Jun 5, 2025
0b55f57
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] Jun 5, 2025
833bb10
Merge branch 'mlcommons:dev' into dev
arjunsuresh Jun 5, 2025
a15e989
Added a parser for system-detail.txt
amd-arsuresh Jun 5, 2025
0d9cdd7
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] Jun 5, 2025
9fa857d
Merge branch 'dev' into dev
arjunsuresh Jun 25, 2025
9fc49f6
Added initial support for mlc doc script
amd-arsuresh Jun 25, 2025
4e285c3
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] Jun 25, 2025
da579d2
Update build_wheels.yml
arjunsuresh Jun 25, 2025
76268ea
Update list_modified_files.py
arjunsuresh Jun 25, 2025
5115c40
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] Jun 25, 2025
09fd954
Update run-tests-on-modified-meta.yml to handle documentation
arjunsuresh Jun 25, 2025
36aab18
Update meta.yaml
arjunsuresh Jun 25, 2025
77ac5bb
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
1d1da6c
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
1742c84
Update doc.py
arjunsuresh Jun 25, 2025
2b86437
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
be6c967
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
8bafe04
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
9c3e29d
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
7e80ef5
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
c5f11d2
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
a098b93
Create document-scripts.yml
arjunsuresh Jun 25, 2025
3656e78
Update run-tests-on-modified-meta.yml
arjunsuresh Jun 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions script/detect-cpu/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def postprocess(i):
else:
env[env_key] = v[1].strip()

if env.get('MLC_HOST_CPU_SOCKETS', '') == '-': # assume as 1
if env.get('MLC_HOST_CPU_SOCKETS', '') in ['-', '']: # assume as 1
env['MLC_HOST_CPU_SOCKETS'] = '1'

if env.get('MLC_HOST_CPU_TOTAL_CORES', '') != '' and env.get(
Expand All @@ -184,9 +184,17 @@ def postprocess(i):
env['MLC_HOST_CPU_THREADS_PER_CORE'] = str(int(int(env['MLC_HOST_CPU_TOTAL_LOGICAL_CORES']) //
int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'])))

if env.get('MLC_HOST_CPU_SOCKETS', '') != '' and env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES',
'') != '' and env.get('MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') == '':
if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '' and env.get(
'MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') == '':
env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET'] = str(
int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES']) // int(env['MLC_HOST_CPU_SOCKETS']))

if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') == '' and env.get(
'MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET', '') != '':
env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'] = str(int(
env['MLC_HOST_CPU_PHYSICAL_CORES_PER_SOCKET']) * int(env['MLC_HOST_CPU_SOCKETS']))

if env.get('MLC_HOST_CPU_TOTAL_PHYSICAL_CORES', '') != '':
env['MLC_HOST_CPU_PHYSICAL_CORES_LIST'] = f"""0-{int(env['MLC_HOST_CPU_TOTAL_PHYSICAL_CORES'])-1}"""

return {'return': 0}
30 changes: 30 additions & 0 deletions script/extract-file/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,39 @@ def preprocess(i):
else:
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvJf'
env['MLC_EXTRACT_TOOL'] = 'tar '
elif filename.endswith(".tar.bz2"):
if windows:
x = '"' if ' ' in filename else ''
env['MLC_EXTRACT_CMD0'] = 'bzip2 -d ' + x + filename + x
filename = filename[:-4] # leave only .tar
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvf'
env['MLC_EXTRACT_TOOL'] = 'tar '
elif os_info['platform'] == 'darwin':
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvjf '
env['MLC_EXTRACT_TOOL'] = 'tar '
else:
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' --skip-old-files -xvjf '
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @arjunsuresh , would --skip-old-files skip the partially written files also if the previous extraction was not clean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tar will not extract even if the file is only partially written.

env['MLC_EXTRACT_TOOL'] = 'tar '
elif filename.endswith(".tar"):
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' -xvf'
env['MLC_EXTRACT_TOOL'] = 'tar '
elif filename.endswith(".7z"):
if windows:
env['MLC_EXTRACT_TOOL'] = '7z'
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y '
else:
# Assumes p7zip is installed and provides the `7z` or `7zr` binary
env['MLC_EXTRACT_TOOL'] = '7z'
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y '

elif filename.endswith(".rar"):
if windows:
env['MLC_EXTRACT_TOOL'] = 'unrar'
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y '
else:
# unrar or unar may be available on Unix-like systems
env['MLC_EXTRACT_TOOL'] = 'unrar'
env['MLC_EXTRACT_TOOL_OPTIONS'] = ' x -y '
elif filename.endswith(".gz"):
# Check target filename
extracted_filename = env.get('MLC_EXTRACT_EXTRACTED_FILENAME', '')
Expand Down
58 changes: 58 additions & 0 deletions script/get-platform-details/parse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import json
import re

# Load the input text from the system-info.txt file
with open("system-info.txt", "r", encoding="utf-8") as f:
data = f.read()

# Define patterns to extract key data points
extracts = {
"uname": r"uname -a\n(.+)",
"username": r"3\. Username\n(.+)",
"uptime": r"2\. w\n\s+.+\s+up\s+(.+?),",
"cpu_model": r"Model name:\s+(.+)",
"cpu_cores": r"Core\(s\) per socket:\s+(\d+)",
"threads_per_core": r"Thread\(s\) per core:\s+(\d+)",
"total_cpus": r"CPU\(s\):\s+(\d+)",
"mem_total_kb": r"MemTotal:\s+(\d+)\s+kB",
"mem_free_kb": r"MemFree:\s+(\d+)\s+kB",
"swap_total_kb": r"SwapTotal:\s+(\d+)\s+kB",
"swap_free_kb": r"SwapFree:\s+(\d+)\s+kB",
"kernel_version": r"kernel.version\s+=\s+(.+)",
"architecture": r"Architecture:\s+(\S+)",
"boot_args": r"13\. Linux kernel boot-time arguments, from /proc/cmdline\n(.+)",
"bios_vendor": r"Vendor:\s+(.+)",
"bios_version": r"Version:\s+([\d\.]+)",
"bios_release_date": r"Release Date:\s+(.+)",
"cpu_frequency_range": r"hardware limits:\s+(.+)",
"virtualization": r"Virtualization:\s+(.+)",
"l1d_cache": r"L1d cache:\s+(.+)",
"l2_cache": r"L2 cache:\s+(.+)",
"l3_cache": r"L3 cache:\s+(.+)",
"numa_nodes": r"NUMA node\(s\):\s+(\d+)",
"runlevel": r"who -r\n\s+run-level\s+(\d+)",
"systemd_version": r"Systemd service manager version\n(.+)",
"max_mhz": r"CPU max MHz:\s+([\d\.]+)",
"min_mhz": r"CPU min MHz:\s+([\d\.]+)",
"bogomips": r"BogoMIPS:\s+([\d\.]+)",
"cache_alignment": r"cache_alignment\s+:\s+(\d+)",
"address_sizes": r"Address sizes:\s+(.+)",
"numactl_total_mem_mb": r"node 0 size:\s+(\d+)\s+MB",
"dimm_actual_speed": r"Speed:\s+(\d+)\s+MT/s",
"dimm_configured_speed": r"Configured Memory Speed:\s+(\d+)\s+MT/s"
}

# Extract matched values
results = []
for key, pattern in extracts.items():
match = re.search(pattern, data)
if match:
results.append({"key": key, "value": match.group(1)})

# Add derived field: number of services
services = re.findall(r"\.service", data)
results.append({"key": "total_services_detected", "value": len(services)})

# Output as JSON array
json_output = json.dumps(results, indent=2)
print(json_output)