Skip to content

Instantly share code, notes, and snippets.

View vsreekanti's full-sized avatar

Vikram Sreekanti vsreekanti

View GitHub Profile
@vsreekanti
vsreekanti / conda-optimized.sh
Created January 19, 2023 16:33
Conda environment creation using an Aqueduct base environment
# Create a base Conda environment with Python 3.9 and the aqueduct-ml package.
# These steps sit outside of the critical path of running a function.
conda create -n aqueduct_py39 python==3.9
conda run -n aqueduct_py39 pip install aqueduct-ml
# Since the Python 3.9 runtime was already downloaded and cached when building
# the base image, this step now only takes 5 seconds.
conda create -n my_workflow_env python==3.9
# This command adds the site package path of aqueduct_py39 to the PYTHONPATH of
@vsreekanti
vsreekanti / conda-naive.sh
Last active January 19, 2023 18:43
Naive Conda environment creation for an Aqueduct function
# Create a Conda environment my_workflow_env with Python 3.9.
# This step takes 16 seconds.
conda create -n my_workflow_env python==3.9
# Install aqueduct-ml and scikit-learn in this environment; Aqueduct is
# required in order to orchestrate the execution of Python functions.
# This is just an example but would likely include other library
# dependencies depending on the use case in question.
# Installing aqueduct-ml takes 42 seconds.
# Installing scikit-learn takes another 4 seconds.
# Create new dataflow with Cloudflow.
flow = cloudflow.Dataflow([(‘url’, str)])
# First, apply img_preproc, then apply three models in parallel.
img = flow.map(img_preproc)
p1 = img.map(resnet_101)
p2 = img.map(vgg_16)
p3 = img.map(inception_v3)
# Combine the results with union, create a group for each input, and pick the highest confidence prediction.
<0xffffff80402b1400>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 12 unplug = 0
mcache: 4 CPU(s), 64 bytes CPU cache line size
mbinit: done [96 MB total pool size, (64/32) split]
rooting via boot-uuid from /chosen: 7B5646BD-13B6-3CBE-8C35-DF1A62C08FBD
Waiting on <dict ID="0"><key>IOProviderClass</key><string ID="1">IOResources</string><key>IOResourceMatch</key><string ID="2">boot-uuid-media</string></dict>
com.apple.AppleFSCompressionTypeZlib kmod start
com.apple.AppleFSCompressionTypeDataless kmod start
com.apple.AppleFSCompressionTypeZlib load succeeded
com.apple.AppleFSCompressionTypeDataless load succeeded
AppleIntelCPUPowerManagementClient: ready
@vsreekanti
vsreekanti / gist:39c14c012b52e0c4a59e
Last active February 11, 2016 19:15
Towers of Hanoi MIPS
# print_msg function takes three arguments and is equivalent to
# snprintf(“Move disk %d from %d to %d.”, $a0, $a1, $a2);
hanoi:
slti $t0, $a0, 2
bne $t0, $0, caseOne
addiu $sp, $sp, -20
sw $a0, 0($sp)
sw $a1, 4($sp)