Skip to content
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

[question]: batch实例数和线程数的关系 #706

Closed
Happiness-Cleaner opened this issue Feb 11, 2025 · 2 comments
Closed

[question]: batch实例数和线程数的关系 #706

Happiness-Cleaner opened this issue Feb 11, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Happiness-Cleaner
Copy link

Happiness-Cleaner commented Feb 11, 2025

Bug Description

你好!我们测试了Genesis官方名为“A Detailed Performance Benchmarking Report on Genesis”报告中的Go2程序在不同batch实例数(即envs)下运行时的最大线程数,测试数据如下图所示。因为我们的测试结果和Genesis官方报告中的一些描述不太相符,这里有一些疑问:

您的报告中说:在Genesis中,batch中的每个环境实例严格只使用一个单线程来模拟,但是在我们的测试中Go2程序在2^9=512个batch之前最大线程数都是47,512到16384个batch之间最大线程数为58。所以您说的线程和我们测试的最大线程数有什么不同?

期待您的解答!

Image

Steps to Reproduce

#!/bin/bash

# 定义最大线程数变量
max_threads=0

# 循环遍历脚本数组
for env in {0..14}; do
    # 启动 Python 脚本并在后台执行
    python3 test_genesis.py -B $((2**$env)) -r --mjx-solver-setting &

    # 获取当前启动的 Python 脚本的进程 PID
    PID=$!
    
    # 输出正在运行的脚本及其 PID
    echo "Running $((2**$env)) batch with PID: $PID"
    
    # 每秒输出一次线程数,直到进程结束
    while true; do

        # 检查进程是否仍在运行
        if ! ps -p $PID > /dev/null; then
            echo "$((2**$env)) (PID $PID) has finished."
            break
        fi

        # 获取进程的线程数
        THREADS=$(ps -o nlwp= -p $PID)
        
        # 比较当前线程数和最大线程数
        if [ "$THREADS" -gt "$max_threads" ]; then
            max_threads=$THREADS
        fi

        # 等待 1 秒后再次检查
        sleep 1
    done
    
    # 输出线程数
    echo "Max Thread count for $((2**$env)) batch (PID $PID): $max_threads"

    # 重置最大线程数变量
    max_threads=0
done

Expected Behavior

batch实例数 == 线程数

Screenshots/Videos

No response

Relevant log output

如上图

Environment

OS: Ubuntu 22.04
GPU: NVIDIA RTX A6000
Driver Version: 565.57.01
CUDA Version: 12.7

Release version or Commit ID

version = "0.2.1"

Additional Context

No response

@Happiness-Cleaner Happiness-Cleaner added the bug Something isn't working label Feb 11, 2025
@Happiness-Cleaner Happiness-Cleaner changed the title [Bug]: batch实例数和线程数的关系 [question]: batch实例数和线程数的关系 Feb 12, 2025
@Happiness-Cleaner Happiness-Cleaner changed the title [question]: batch实例数和线程数的关系 [Bug]: batch实例数和线程数的关系 Feb 12, 2025
@Happiness-Cleaner Happiness-Cleaner changed the title [Bug]: batch实例数和线程数的关系 [question]: batch实例数和线程数的关系 Feb 12, 2025
@YilingQiao
Copy link
Collaborator

We were referring to GPU thread for simulation.

@YilingQiao
Copy link
Collaborator

THREADS=$(ps -o nlwp= -p $PID)

Is not for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants