MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / get_op_cache_config

Function get_op_cache_config

examples/pytorch/decoding/utils/decoding.py:40–46  ·  view source on GitHub ↗
(size_per_head, is_fp32)

Source from the content-addressed store, hash-verified

38to_torch_type = {'fp32' : torch.float32, 'fp16' : torch.float16, 'bf16' : torch.bfloat16}
39
40def get_op_cache_config(size_per_head, is_fp32):
41 x = 4 if is_fp32 else 8
42 use_batch_major_op_cache = True if USE_CACHE_BATCH_MAJOR_ATTENTION == True and \
43 size_per_head % x == 0 \
44 else False
45 x = x if use_batch_major_op_cache else 1
46 return use_batch_major_op_cache, x
47
48
49class DecodingWeights(object):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected