Skip to content

pytorch benchmark fix#11

Open
Trinity-142 wants to merge 1 commit into
n00bmasters:masterfrom
Trinity-142:pytorch-bench
Open

pytorch benchmark fix#11
Trinity-142 wants to merge 1 commit into
n00bmasters:masterfrom
Trinity-142:pytorch-bench

Conversation

@Trinity-142
Copy link
Copy Markdown
Collaborator

@Trinity-142 Trinity-142 commented May 25, 2026

WARMUP: Time spent avg 0.371218 mcs
torch rect: Time spent avg 11.572838 mcs
torch rect cpu: Time spent avg 131.718397 mcs
torch square: Time spent avg 0.045538 mcs
cutesseract rect: Time spent avg 89.217663 mcs
cutesseract square: Time spent avg 0.053167 mcs
torch rect fp16: Time spent avg 2.773046 mcs
cutesseract rect wmma fp16: Time spent avg 5.310059 mcs
torch rect bf16: Time spent avg 2.762318 mcs
cutesseract rect wmma bf16: Time spent avg 5.211353 mcs

уменьшил размер квадратного семпла потому что иначе ncu не собирался
на скринах 2 и 3 видно, что pytorch bf16 использует тензор коры
image
image

image

@Trinity-142 Trinity-142 requested a review from Wokzy May 25, 2026 13:23
@Trinity-142 Trinity-142 changed the title fix pytorch benchmark fix May 25, 2026
Copy link
Copy Markdown
Collaborator

@Wokzy Wokzy left a comment

Choose a reason for hiding this comment

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

ncu нас не особо интересует, важнее nsys, я думаю он потянет большие размеры (на плюсах во всяком случае потянул)

Comment on lines +59 to +61
rect_samples = generate_samples(1, (2048, 8192, 2048), device='cuda:0', dtype=torch.float32)
rect_samples_cpu = generate_samples(1, (2048, 8192, 2048), device='cpu', dtype=torch.float32)
square_samples = generate_samples(1, (128, 128, 128), device='cuda:0', dtype=torch.float32)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Погоди, а зачем это, они же в кеши попадут эти матрицы или не? Как будто неправдоподобный перф может быть

@Trinity-142
Copy link
Copy Markdown
Collaborator Author

ncu нас не особо интересует, важнее nsys, я думаю он потянет большие размеры (на плюсах во всяком случае потянул)

Я не нашел в nsys инфу по тензор корам

Comment on lines +15 to +17
for _ in range(3):
torch.matmul(a[0], b[0], out=res[0])
torch.cuda.synchronize()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Чудеса.... Торч только лишь за счёт этого вармапа лучше. Надо профили смотреть

bench_torch(*rect_samples)

print('cutesseract rect wmma bf16: ', end='')
bench_cutesseract(gemm_wmma_fp16, *rect_samples, out_dtype=torch.float32)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Тут я обдристался в моменте, должно быть gemm_wmma_bf16. Сверху его тоже импортировать нужно. Докинешь пж?

@Wokzy
Copy link
Copy Markdown
Collaborator

Wokzy commented May 25, 2026

Глобально вернуть бы наборы по 10 штук и фиксануть bf16 вызов, а так всё ок

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.

2 participants