Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix InputFeatures .to #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix InputFeatures .to #193

wants to merge 1 commit into from

Conversation

NicholasCao
Copy link

@NicholasCao NicholasCao commented Sep 12, 2022

In the following two scenarios,

for step, inputs in enumerate(cycle(train_dataloader)):
    inputs = inputs.to(device)
    ...

or

dataloader = cycle(iter(train_dataloader))
for step in range(max_steps):
    input = next(dataloader)
    inputs = inputs.to(device)
    ...

raw InputFeatures.to(...) causes infinite growth of GPU memory and unavailability of used inputs (e.g. SoftTemplate modifies input_ids of inputs by batch['input_ids'] = None)

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.

1 participant