Purdue-P Coprocessor Connection Tutorial
Purdue-P brings the power of an
optimized probabilistic computer to MATLAB. This
tutorial will describe how to set up your MATLAB
environment such that the function call to run a
p-circuit will connect to the cloud, run the
p-circuit on an FPGA, and receive the results in
the form of a variable.
Within minutes, have access to a cloud computer
specialized to run probabilistic spin logic
algorithms.
Step 1 : Acquire Matlab
- Acquire a working version of MATLAB, dated 2018 or newer. The FPGA coprocessor has been designed to be accessed directly from MATLAB.
Step 2: Launch an AWS Purdue-P Instance
- Create an AWS account. You may need to request an increase to the F1 instance limit (Amazon's fpga server instances), which is by default set to 0. The request can be made to Amazon here. These servers require special permission from AWS to use.
- Email purdueppermissions@gmail.com
with a request to access the purdue-p machine image (there are 3
options) and fpga image. Permissions will be given to access the FPGA
image required to implement the purdue-p design. Please be sure to
include your AWS Account Number, required topology, and affiliation.
There are 3 topologies available, described below.
- 90 x 90 (8100 p-bit) Nearest neighbor topology where each p-bit is connected to 4 of its nearest neighbors.
- 400 p-bit all to all topology where every p-bit is connected to every other p-bit.
- 8x250 Quantum Annealing topology that is specialized to emulate q-bits with p-bits.
- Navigate to instance on the left hand column in the Amazon EC2 console.
Select Launch Instance
- Step 1. Search for the AMI “Purdue-P FPGA AMI” and select it (It will be under My AMI's). This option will only be available after you have been given permission to use the Purdue-P AMI.
- Step 2. Scroll down to “f1.2xlarge” and select it. Click Next: Configure Instance Details.
- Click Next: Add Storage.
- Click Next: Add Tags.
- Click Next: Configure Security Group. Select create a new security group. Give it some name and description akin to “Purdue-P security group” and “Contains rules to access Purdue-P instance”, respectively. A few rules need to be added to allow your computer to communicate with the server. These rules are listed below. i. Already exists: SSH, Port Range: 22, Source: Anywhere, Description: “SSH access”
- Select Review and launch, and select Launch.
- At this stage, create a new keypair by following the provided instructions. Download the file, and store it in a safe place.
- Scroll down and click on View Instances.
ii. Custom TCP Rule, Port Range: 80, Source: Anywhere, Description: “HTTP for user data”
iii. Custom TCP Rule, Port Range: 443, Source: Anywhere, Description: “HTTPS for user data”
iv. Custom TCP Rule, Port Range: 1234, Source: Anywhere, Description: “Purdue-P Server port” - A new instance should appear with a green dot. Wait until status checks changes from “Initializing” to “2/2 checks…”.
Step 3: Run MATLAB Codes using Coprocessor
- Download psl_accel.mexw64 and store in some dedicated folder. This is a pre-compiled code that will allow matlab to communicate with the fpga-host server.

psl_accel.mexw64 |
2. Download the following example
codes/files and store in the same folder as psl_accel.mexw64. Each is labeled to match
the topology for which the example can run on.
3. Open MATLAB, and run the
.m which matches the AMI which was spun up earlier.
Thats it! Try the sample programs provided or write your own codes that can make use of this powerful coprocessor.
Thats it! Try the sample programs provided or write your own codes that can make use of this powerful coprocessor.
Tips
Remember to stop the instance once you are done. This can be
done by right clicking on the instance in the ec2 amazon console and selecting
instance state >> stop. Otherwise you will
continue to be billed as long as the server is active.
Every time the instance Is restarted, a new IP address is given. The new IP address must be inserted into the matlab file inside the psl_accel("SetIpAndPort") call.
Please forward concerns, questions, or suggestions to purdueppermissions@gmail.com
Every time the instance Is restarted, a new IP address is given. The new IP address must be inserted into the matlab file inside the psl_accel("SetIpAndPort") call.
Please forward concerns, questions, or suggestions to purdueppermissions@gmail.com