Skip to content

peak memory calculation #9

Description

@vincent-pli

I saw this line in source code:

_ = self.forward(input_ids, seq_ids, [], ignore_kvcache=True)
torch.cuda.synchronize()
# peak_memory = torch.cuda.max_memory_allocated()
# total_memory = torch.cuda.get_device_properties(0).total_memory
free_memory, total_memory = torch.cuda.mem_get_info()
peak_memory = total_memory - free_memory

after forward, some memory has been released, for example memory for Intermediate Activations and memory for input ids .etc
so could the calculation make a high block numbers than reality?
thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions