Femtorun defines the runtime interface for Femtosense software
Project description
Femtosense Femtodriver
Using the memory images emitted by femtocrux, creates an SD card programming file that the EVK firmware uses.
License
By using this software package, you agree to abide by the terms and conditions in the license agreement found here.
Installation:
From PyPI:
pip install femtodriver
This will install the femtodrive
executable.
Python 3.10 is required. Femtocrux requires docker to be installed (see other instructions for femtocrux).
Usage:
To show all options:
femtodrive --help
To generate SD programming files from a previously generated Femtocrux memory image zip
femtodrive <path-to-zipfile_from_femtocrux>
This will create model_datas/<stem of zipfile path>/
.
Inside, along with other information, there will be a io_records/apb_records
. This holds the 0PROG_A
and 0PROG_D
files which can be downloaded to the SD card. Note that future firmware might allow multiple models to coexist on the SD card. The leading '0' indicates that this is the first model. In some cases, with multiple models loaded, you may need to edit the number in the filename.
Historical note: this replaces sd_from_femtocrux.py
in femtodriverpub
.
To generate SD programming files from a previously saved FQIR pickle
You can pickle femtocrux's input, the FQIR graph, with torch.save()
(In the pytorch femtocrux walkthroughs, this variable is called fqir_graph
).
This way, femtodrive
can use femtocrux to compile the model and emit program binaries, as is done directly in the notebooks.
Example:
femtodrive ../models/my_model.pt
As a "hello world" you can invoke:
femtodrive LOOPBACK
This will call femtodrive on an "identity" network that is installed with the package. As before, output will be put in model_datas/<stem of pickle filename>/
. Notice the images.zip
that appears and was unpacked to docker_data/
.
(Pickles are notoriously unportable. Ideally, any pickling/unpickling is done on one machine, but failing that, try to ensure the pickle is unpacked using the same package versions it was generated with)
Simulation With Femtodriver via Femtocrux
When the FQIR pickle is supplied, it is also possible to simulate the model using femtodriver. In this case, pass "fasmir" to the --runners
argument.
femtodrive ../models/my_model.pt --runners="fasmir"
See femtodrive --help
for the options related to passing inputs and retreiving outputs.
Misc
Note that many femtodrive
options pertain to running an attached SPU directly. As of 6/24, an EVK has not been made available that allows external use of these features.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for femtodriver-0.17.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6ce2a455882155b106d4d70abfe1752a6a211c6db710f0a3d4f641e99f74e77 |
|
MD5 | b2f67e1a8b953bb3146440277b498b32 |
|
BLAKE2b-256 | 961975638268bddada9861a7a5e7ab2f3e22e40cda2563debb1cad46f9549710 |