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

Avoid h2d - d2h roundtrip when using unflatten #861

Merged

Commits on Mar 13, 2023

  1. Avoid h2d - d2h roundtrip when using unflatten

    `unflatten` converts its `lengths` argument to a NumPy array, because
    CuPy's `split` function requires lengths to be in CPU memory. However,
    in various places in Thinc, we copy the lengths array to GPU memory when
    CupyOps is used. This results in an unnecessary roundtrip of the lengths
    array (host to device -> device to host). One of these roundtrips
    (array `list2array`) showed up in profiles of the biaffine parser.
    
    This change fixes some length array allocations to avoid the round trip.
    danieldk committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    965f064 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f12a2f View commit details
    Browse the repository at this point in the history