Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Converting the list to ndarray for speedup #4470

Merged
merged 1 commit into from Apr 9, 2022

Conversation

askender
Copy link
Contributor

@askender askender commented Apr 1, 2022

Patch description
Creating a tensor from a list of numpy.ndarrays is extremely slow.
converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor.

Testing steps
re-run parlai train_model --model projects.blenderbot2.agents.blenderbot2:BlenderBot2FidAgent ***, and no UserWarning again.

Creating a tensor from a list of numpy.ndarrays is extremely slow.
converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor.
@facebook-github-bot
Copy link

Hi @askender!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

Copy link
Contributor

@stephenroller stephenroller left a comment

Choose a reason for hiding this comment

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

Thanks!

@stephenroller
Copy link
Contributor

(Please just sign the CLA)

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@askender
Copy link
Contributor Author

askender commented Apr 2, 2022

I think the Some checks were not successful
such as E FileNotFoundError: [Errno 2] No such file or directory: '/home/circleci/ParlAI/data/wizard_of_wikipedia/data.json'
is not related to my pull-request.

@stephenroller Thanks. I will do more useful pull-request. ParlAI is cool.

@stephenroller
Copy link
Contributor

I'll rerun tests on Monday. It's slightly suspicious but the code looks good

@stephenroller stephenroller merged commit 755b9dc into facebookresearch:main Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants