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

changed 128 items per CTA to 256 items #13

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions fbgemm_gpu/codegen/embedding_backward_split_template.cu
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,11 @@ split_embedding{{ "_nobag" if nobag else "" }}_backward_codegen_{{ optimizer }}_
->philox_cuda_state(4);
}
{% endif %}
{% for kMaxVecsPerThread in range(1, max_embedding_dim // 128 + 1) %}
{% for kMaxVecsPerThread in range(1, max_embedding_dim // 256 + 1) %}
{% if not nobag %}
if (max_D <= {{ 128 * kMaxVecsPerThread }}) {
if (max_D <= {{ 256 * kMaxVecsPerThread }}) {
{% else %}
if (D <= {{ 128 * kMaxVecsPerThread }}) {
if (D <= {{ 256 * kMaxVecsPerThread }}) {
{% endif %}
// Stay under used_shared_kb of shared memory (V100: 64 KB; A100: 96 KB), BT_block_size must be a power of two.
while (BT_block_size * sizeof(at::acc_type<{{ "scalar_t" if dense else "cache_t" }}, true>) * 4 * kWarpSize * {{ kMaxVecsPerThread }} >= used_shared_bytes) {
Expand Down
4 changes: 2 additions & 2 deletions fbgemm_gpu/codegen/embedding_forward_split_template.cu
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ Tensor {{ "dense" if dense else "split" }}_embedding{{ "_nobag" if nobag else ""
{% endif %}
"batched_embedding{{ "_nobag" if nobag else "" }}_forward_kernel_2", [&] {
{% if not nobag %}
{% for kMaxVecsPerThread in range(1, max_embedding_dim // 128 + 1) %}
if (max_D <= {{ 128 * kMaxVecsPerThread }}) {
{% for kMaxVecsPerThread in range(1, max_embedding_dim // 256 + 1) %}
if (max_D <= {{ 256 * kMaxVecsPerThread }}) {
{% if not dense %}
split_embedding_codegen_forward_{{ wdesc }}_kernel<emb_t, cache_t, output_t, int64_t, {{ kMaxVecsPerThread }}><<<
{% else %}
Expand Down