Skip to content

Commit

Permalink
Refactor generate_cache_tbes in unit test (#2304)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2304

Removed unused args from `generate_cache_tbes`

Reviewed By: q10

Differential Revision: D53305015

fbshipit-source-id: 12572d794e912f272e6c16dba6646d6e420ad6ec
  • Loading branch information
sryap authored and facebook-github-bot committed Feb 1, 2024
1 parent b347a43 commit 79f4862
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions fbgemm_gpu/test/tbe/cache_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
def generate_cache_tbes(
T: int,
D: int,
B: int,
log_E: int,
L: int,
mixed: bool,
cache_algorithm: CacheAlgorithm = CacheAlgorithm.LRU,
prefetch_pipeline: bool = False,
Expand Down
2 changes: 0 additions & 2 deletions fbgemm_gpu/test/tbe/cache_overflow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def test_cache_int32_overflow(self) -> None:
cc, cc_ref, _, _ = generate_cache_tbes(
T=1,
D=D_fac,
B=128,
log_E=1,
L=1,
mixed=False,
prefetch_pipeline=True,
cache_sets=cache_sets,
Expand Down
10 changes: 8 additions & 2 deletions fbgemm_gpu/test/tbe/cache_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_cache_pipeline(
cache_algorithm: CacheAlgorithm,
) -> None:
cc, cc_ref, min_Es, sum_Ds = generate_cache_tbes(
T, D, B, log_E, L, mixed, cache_algorithm
T, D, log_E, mixed, cache_algorithm
)
iters = 3
requests = generate_requests(iters, B, T, L, min_Es, reuse=0.1)
Expand Down Expand Up @@ -101,7 +101,13 @@ def _test_cache_prefetch_pipeline( # noqa C901

assert prefetch_location in ["before_fwd", "between_fwd_bwd"]
cc, cc_ref, min_Es, sum_Ds = generate_cache_tbes(
T, D, B, log_E, L, mixed, CacheAlgorithm.LRU, True, True
T,
D,
log_E,
mixed,
CacheAlgorithm.LRU,
prefetch_pipeline=True,
use_int_weight=True,
)
iters = 5
requests = generate_requests(iters, B, T, L, min_Es, reuse=0.1)
Expand Down

0 comments on commit 79f4862

Please sign in to comment.