Using your Github account (create one if you have not made one yet!), navigate to this link and click on the "Get your Pack" link. Follow the instructions given in the link in order to gain access to the GitHub student pack. Once you receive access to the pack, click on the unique link to the AWS educate page in order to receive your credits. It should look as follows (note that I have since already redeemed my promo code so it will first prompt you to generate the unique link!):
After clicking on the link above, click on the student option and use your UCSD email to complete the form. Perhaps the most important thing to do before completing the second step is to copy the 11-digit unique AWS promo code on the bottom right entry box of the page. If you do not do this you will need to email customer support to receive the proper credits on a non-student AWS account. DO NOT FORGET TO COPY THE CODE!
With the code in hand, the final step is to either create a student account for sole use with the credits or use a traditional AWS to receive the credits. My suggestion is to first create an AWS account if you have a credit card for use simply because you get twice the amount of credits if you do so. Otherwise, feel free to create a student AWS account using the second option. This last step should look similar to the image below:
Finally, we want to use the code copied above for redeeming the credits. Usually this process is taken care of if you decide to go through with making a new account based off of your education account; otherwise, navigate to the EC2 billing management page. Under the credits tab, enter your promo code and you should be credited at least $75 worth of credits (it should be more if you made an account with an associated credit card).
Now, with an AWS account with credits, we should be able to create the two instances that we need to do compute. Unfortunately, this is made difficult by the fact that GPU compute is generally limited by scarcity (mostly due to cost). Fortunately, AWS is pretty lenient when it comes to allowing allocations for low-end to mid-end GPUs, so we will request a GPU instance that uses a K520 GPU (g2.2xlarge).
Use the following link in order to open the AWS EC2 request page. You will need to submit a request for a service limit increase in EC2 instances in the US West-1 (Oregon) region for the g2.2xlarge instance type. You will only need one for this project. Under the case description section, just let it be known that this instance will be used for a deep learning project. Feel free to be as specific as you want, but being more vague will likely cause the request to be delayed a bit longer.
TLDR: for the AWS savy, we want to create two instances, one g2.2xlarge instance for GPU training and one t2.micro instance for evaluation and server interfacing. The AMI for both instances can be found in the US West-1 (Oregon) region and can be found with the AMI specifier ami-3b6bce43. For the micro instance, allow any connections to port 8080 on the instance under the TCP protocol. For those unfamiliar, read on!
The process to create instances is fairly simple. Starting from the EC2 Dashboard, click on the launch instance button under the create instance subsection. From the AMI selection page, click on the "Community AMI" button and search for the Deep Learning AMI (Ubuntu) Version 2.0 by typing the AMI specifier ami-3b6bce43 on the AMI search bar. If you cannot find the AMI, then you are not creating the instance in the proper region! The desired AMI will look as follows:
Now, select the above AMI, and choose a t2.micro instance for use (this should be the default selection). After this, select the "Review and Launch" button on the bottom right to get an overview of the instance specifications. We need to make one small change to the instance at this point. Since we want to treat the micro instance as a server that will handle client requests we also need to open a port to access the instance remotely. From the Review Instance Launch page, modify the security groups by adding a general TCP rule to allow inbound connections to port 8080. Do not modify the sources allowed. If all is done correctly, the instance review page should now look as follows:
Finally, we create one more instance that is exactly the same as the previous instance with the only difference being that the instance type is g2.2xlarge. Since only training will be done on this instance, there is no need to specify the extra free port for this instance. That means that you do not have to do very much in order to properly set-up the GPU instance in EC2.
Note that this GPU instance is fairly expensive, so you will need to learn how to manage your instances to make sure that the charges do not build up to quickly. To give a brief overview of how it works, you will want to navigate to your EC2 Dashboard and see what your running instances are. The most important thing to know for now is that since the instances are paid for by the hour, you will want to shut them down as soon as you know you will not be using them. You can do this by right-clicking the instance and changing the instance state to "Stop". Do not use terminate an instance unless you are sure that you will not be using it again as this will delete the instance in its entirety. After finishing this section, feel free to turn off the instances as they will not be used until later in this project.
The following sections detail how to access the instance using either a Windows or Linux installation. If you are using a computer with OSX, then simply follow the Unix guide. Of course, this part assumes that any Unix users have prior experience using the terminal.
Unix users have it easy for this section of the setup. Since ssh and scp are provided by default on all Linux distributions and OSX, there is no need for a specialized FTP/SSH program. In order to access the server directly, you will need to keep note of either the public IPv4 DNS or the public IPv4 IP address. Either one can be used as a means of connecting to your machine, but the public DNS makes it obvious what cluster you are contacting. To access the server interactively through the terminal, run the following command while replacing the bracketed parts with what is expected to be there:
ssh -i [/location/to/pemFile] [user]@[public IPv4 address/DNS] If you selected the correct AMI and did not change the instance launch settings, then the user should still be ubtuntu. The public IPv4 DNS/IP can be found in the instance description page on the top right corner of the instance information panel. Alternatively, right clicking the instance and selecting "Connect" should bring up the same list of commands used above with the correct arguments assuming your key file is in the same directory and has the proper permission values.
On Windows, since Amazon automatically generated the private key beforehand, all it takes is a small change in the typical preferences associated with the default setups. There will be two different programs covered. The first will be MobaXterm due to its all-in-one appeal (that is, it allows you to FTP and SSH at the same time). The second will be PuTTY, which is simply one of the most lightweight telnet programs available (and the one that many used in ECE 15).
The settings for MobaXterm are straightforward. Once the program is opened, create a new remote session and use the following as a template for your connection (filling in what is necessary to fill in):
On the other hand, if you are using PuTTY in order to access the instance, then the following three images describe how the client should be configured:
The first image shows how the initial screen of PuTTY should be configured. Since AWS uses an SSH key pair in order to authenticate a user, you must also modify the SSH settings in order to properly use the SSH key. Notice, however, that while Linux (and MobaXterm) can use a .pem key file by default, PuTTY must have the key converted into its own format first! In order to do that, use PuTTYgen to load the key.pem from AWS and then select the "Save private key" button. This will convert the normal private key into a specially formatted key that PuTTY can understand. This key can then be placed in the configuration window of PuTTY.
Software configuration given the Amazon AMI is as easy as can be. All that is required is a single call to a source command to download, install, and activate an environment from which Keras and TensorFlow can be used in ease. After an SSH connection succeeds, you may notice a long list of commands listed that allow you to select specific environments. It will look similar to the dialog below:
For the remainder of this project, it is assumed that we would like to use TensorFlow on top of Python 3. So, students should run the following command upon the start of an SSH session if they would like to use Keras+TensorFlow on Python 3:
source activate tensorflow_p36Note that the TensorFlow installation in this old AMI is likely to be a bit dated. However, most of the API that we will be using will be consistent across all version (1.xx), so there should be no issue when completing this assignment even on a personal computer.
Amazon's AWS EC2 service is one of the most convenient cloud computing services that is available. There is essentially no restriction on a student's account so long as it is tied to some form of payment. Furthermore, they tend to respond to issues quickly (although that has been changing as of recently). One thing to appreciate EC2 for, however, is how streamlined it's service is. Compared to Azure, AWS allows for users to create their own AMIs, essentially making drive duplication across users something that takes a few clicks.
This marks the end of the AWS usage guide. Please go on with the rest of the project in the main page.