"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "483201d484f6f0842580a2ea04a1a3ab96e1c6f5"
Commit f95c2fc1 authored by Tri Dao's avatar Tri Dao
Browse files

[Gen] Remove commented code

parent b4859900
...@@ -97,7 +97,6 @@ def decode(input_ids, model, max_length, top_k=1, top_p=0.0, temperature=1.0, ...@@ -97,7 +97,6 @@ def decode(input_ids, model, max_length, top_k=1, top_p=0.0, temperature=1.0,
if cg: if cg:
assert fused_ft_kernel assert fused_ft_kernel
run, cg_cache = capture_cg(model, inference_params, batch_size, seqlen_og, max_length) run, cg_cache = capture_cg(model, inference_params, batch_size, seqlen_og, max_length)
# with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA], record_shapes=True) as prof:
if timing: if timing:
start = time.time() start = time.time()
while True: while True:
...@@ -117,8 +116,6 @@ def decode(input_ids, model, max_length, top_k=1, top_p=0.0, temperature=1.0, ...@@ -117,8 +116,6 @@ def decode(input_ids, model, max_length, top_k=1, top_p=0.0, temperature=1.0,
break break
if timing: if timing:
print(f'Decoding time: {time.time() - start}') print(f'Decoding time: {time.time() - start}')
# print(prof.key_averages().table(sort_by="cuda_time_total", row_limit=50))
# prof.export_chrome_trace("gpt2s_generation.json")
output_cls = GreedySearchDecoderOnlyOutput if top_k == 1 else SampleDecoderOnlyOutput output_cls = GreedySearchDecoderOnlyOutput if top_k == 1 else SampleDecoderOnlyOutput
return output_cls( return output_cls(
sequences=torch.cat([input_ids, torch.stack(sequences, dim=1)], dim=1), sequences=torch.cat([input_ids, torch.stack(sequences, dim=1)], dim=1),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment