Skip to content

Conversation

@gongchensu
Copy link
Collaborator

…afety
解决天数上推理的问题

@gongchensu gongchensu self-assigned this Dec 2, 2025
# -------------------------------------------------------------------------- #
start_time = time.time()
logits = self(**model_inputs)
# Ensure computation is complete - sync stream before reading logits
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个同步可以去掉

f" Time per step: decoder {round(sum(time_list[1:]) / (len(time_list) - 1), 2)} token/ms \n",
)

if len(time_list) > 0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

if len(time_list) > 1

print(
f"\n\n\n Time per step: prefill {round(time_list[0], 2)} token/ms\n",
)
if len(time_list) > 1:
Copy link
Collaborator

Choose a reason for hiding this comment

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

删了

element_size, np_dtype = dtype_info_map.get(infini_tensor_cpu.dtype, (4, np.float32))

# Use safer approach: allocate memory first, then copy
import ctypes
Copy link
Collaborator

Choose a reason for hiding this comment

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

放到最上面去

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