Building PyTorch From Scratch Terminated

PyTorch wheel for Python version >= 3.6 is unavailable.

So I just making PyTorch for Python 3.11.0 from scratch. Turns out the process is unexpectedly terminated.

Is there any solution to start again from latest checkpoint, since it takes forever to build it in Jetson Nano I don’t wanna start over again from the beginning, is it possible?

Thanks in advance.

Hi @3332190067, see this thread for suggestions (namely about using ccache)

I don’t believe there is a way to continue your last build incrementally, since it probably wasn’t using one of the above methods. If you got a killed message at some point (or in the dmesg kernel log), it means your board probably ran out-of-memory and that you need to mount more SWAP.

Thanks for the answer. Yes, I got killed message. Well, turns out it actually not restarting from the beginning, it is resumed (yay).

I have another question, how to apply the patch? (I’m new to Linux) and is it only applied once? Or everytime you run script you have to reapply it? Thanks in advance! @dusty_nv

@3332190067 that’s great that it continued the build for you! The patches, I typically apply “by hand” (meaning just looking the diff file and manually making the changes in the associated PyTorch files) - this is to account for any differences in the version of PyTorch you’re building versus the version of PyTorch that I originally made the patch for. Yes, you can use the patch tool or git apply and it will overcome some minor differences, however I prefer to “know” what has changed as to not encounter strange/cryptic errors later on. Plus, the patches are short to apply, and you only need to apply it once (not everytime you run

Thanks for the answer. Once it’s done, where is the location of the PyTorch that has been built? Is it exported as a Wheel file?

The whl should be under /dist if I recall correctly (presuming that you ran bdist_wheel)

1 Like

When I apply patches “by hand” this is what I get, am I doing it right?

Hi @3332190067, assuming that you already made edits manually to pytorch source files, try running git status and git diff from your pytorch directory, and it will show you a diff of the changes that you made.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.