Skip to content

gpt2_lm.generate() always recompiles #779

@mattdangerw

Description

@mattdangerw

In our current implementation, every call to generate will trigger compilation, meaning generate() is quite slow.

There are actually a few reasons for this.

  • Our sampler objects are regenerated each call generate().
  • Inside the sampler object, sample() is explicitly recompiled each call.
  • The sample object has python objects passed to it (a python function), meaning it will always retrace.

We need to make sure that subsequent calls to generate() with the same settings do not trigger extra compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions