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 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 source, from femtodriver/femtodriver/
pip install -e .
Or from PyPI:
pip install femtodriver
In addition to the package, this will install two executables:
sd_from_femtocrux
and femtodrive
.
Python 3.10 is required. Femtocrux requires docker to be installed (see other instructions for femtocrux).
Usage:
To generate SD programming files from a previously generated memory image zip
First, unpack the memory image .zip emitted by femtocrux.
sd_from_femtocrux <path-to-unzipped-femtocrux-output-directory>
this will create an apb_records
directory, which has 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.
To generate SD programming files from a previously saved FQIR pickle
This currently only works with the PyTorch flow. For now, for TFLite use sd_from_femtocrux
.
You can pickle the femtocrux's input, the FQIR graph, with torch.save()
(In the pytorch/TF femtocrux walkthroughs, this variable is called fqir_graph
).
femtodrive
works on these pickles, invoking the femtocrux docker to compile them and produce a zip containing memory images. It then does the same thing that sd_from_femtocrux
does, producing SD card programming files.
For now, you must supply the --norun
option (in the future, this is the script that will be used to control a cable-connected SPU)
Example:
femtodrive ../models/my_model.pt --norun
As a "hello world" you can invoke:
femtodrive LOOPBACK --norun
This will call femtodrive on an "identity" network that is installed with the package.
Notice the images.zip
that appears and was unpacked to docker_data/
. apb_records
can be found in model_datas/<supplied model name>/io_records
and contains the same contents as with sd_from_femtocrux
.
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 tool versions it was generated with.
Future
With EVK3, femtodrive
enables:
- a direct connection
PC <--(USB)--> host <--(SPI)--> SPU
- this will allow for direct issuing of SPI commands from the PC to the SPU
- it will also enable side-by-side comparison of the SPU and the golden model running inside the docker container
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
File details
Details for the file femtodriver-0.16.0-py3-none-any.whl
.
File metadata
- Download URL: femtodriver-0.16.0-py3-none-any.whl
- Upload date:
- Size: 62.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c79bd49323e5a8de2d3e6ba567de13f505a2297d1dcbf9282f3a93eb49e79f9 |
|
MD5 | cd4c650f546407adf1f65043d9c38172 |
|
BLAKE2b-256 | 58de42c9774a0f667ee1cbe5722f2a819088cbf30791767108f8ae6634b4fa75 |