From d5b7afbf6e752da217a60cde08afd414f73e9e55 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 30 Jul 2023 11:18:11 -0400 Subject: [PATCH] +micromamba (#2681) --- .../github.com/mamba-org/micro/package.yml | 48 +++++++++++++++++++ projects/github.com/mamba-org/micro/test.py | 20 ++++++++ 2 files changed, 68 insertions(+) create mode 100644 projects/github.com/mamba-org/micro/package.yml create mode 100755 projects/github.com/mamba-org/micro/test.py diff --git a/projects/github.com/mamba-org/micro/package.yml b/projects/github.com/mamba-org/micro/package.yml new file mode 100644 index 00000000..64d6c0c6 --- /dev/null +++ b/projects/github.com/mamba-org/micro/package.yml @@ -0,0 +1,48 @@ +versions: + github: mamba-org/micromamba-releases + strip: /-\d+$/ + #FIXME ^^ versions are eg. 1.2.3-1 where the releases are usually -0 + # ^^ and revisions are increments of 1 so this is actually a 4th version + # ^^ number for us that we need to extract + +provides: + - bin/micromamba + +warnings: + - vendored + +platforms: + - darwin + # broken on linux pending https://github.com/mamba-org/mamba/issues/2650 + +dependencies: + curl.se/ca-certs: '*' + +runtime: + env: + REQUESTS_CA_BUNDLE: ${{deps.curl.se/ca-certs.prefix}}/ssl/cert.pem + +build: + dependencies: + curl.se: '*' + sourceware.org/bzip2: '*' + working-directory: "{{prefix}}" + script: | + curl -L \ + "https://github.com/mamba-org/micromamba-releases/releases/download/{{version.tag}}/micromamba-$PID.tar.bz2" \ + | tar xj + rm -rf info + env: + linux/x86-64: {PID: linux-64} + linux/aarch64: {PID: linux-aarch64} + darwin/x86-64: {PID: osx-64} + darwin/aarch64: {PID: osx-arm64} + +test: + - micromamba | grep {{version}} + + - | + eval "$(micromamba shell hook --shell bash)" + micromamba create numpy --channel anaconda --prefix mm-prefix --yes + micromamba activate mm-prefix + ./test.py diff --git a/projects/github.com/mamba-org/micro/test.py b/projects/github.com/mamba-org/micro/test.py new file mode 100755 index 00000000..abc72b2c --- /dev/null +++ b/projects/github.com/mamba-org/micro/test.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# https://www.pugetsystems.com/labs/hpc/standalone-python-conda-envs-without-installing-conda-using-micromamba-2287/ + +""" +Matrix multiplication of 2 n x n matrices +""" + +import numpy as np +import time + +n = 8000 +A = np.array(np.random.rand(n, n)) +B = np.array(np.random.rand(n, n)) +C = np.empty_like(A) + +start_time = time.time() +C = np.matmul(A, B) +run_time = time.time() - start_time + +print( f'{(2e-9 * (n ** 3 + n ** 2)) / run_time :.2f} GFLOPS' )