This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ghcr.io/nvidia/jax:jax | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| cmake \ | |
| git \ | |
| libgoogle-glog-dev \ |
For my GSoC project this year, I'm working on an integration between JAX and Kubeflow Trainer v2.
There are multiple challenges which requires consideration, one of them is how to keep multiple backend setup in a single container, when I don't want to have multiple templates / blueprints, i need to validate it.
my current implementation for docker:
FROM python:3.10-bullseye
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import math | |
| import matplotlib.pyplot as plt | |
| import torch | |
| import torch.nn as nn | |
| from sklearn.datasets import make_moons | |
| from torch import Tensor | |
| from tqdm import tqdm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import functools | |
| def time_step(func): | |
| """ | |
| A Metaflow-specific decorator to measure and log the execution time of a @step. | |
| This decorator is intended to be used on Metaflow step functions only. | |
| It stores the step's execution duration (in seconds) in the `step_timings` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable no-template-curly-in-string */ | |
| const gitlabUrl = 'https://gitlab.com' | |
| const gitlabApiPathPrefix = '/api/v4' | |
| const assets = [ | |
| { path: 'index.js', label: 'JS distribution' } | |
| ] | |
| const verifyConditions = [ | |
| ['@semantic-release/changelog'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it("should get the client timezone as a string", () => { | |
| const DateTimeFormat = Intl.DateTimeFormat; | |
| vi.spyOn(global.Intl, "DateTimeFormat").mockImplementation( | |
| (locale, options) => | |
| new DateTimeFormat(locale, { ...options, timeZone: "Asia/Tehran" }) | |
| ); | |
| const date: MyDate = new MyDate("2023-03-28T11:06:48+00:00"); | |
| expect(date.getClientTZ()).toEqual("Asia/Tehran"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Consistent version of `useMutableSource`, Inspired by https://github.com/pmndrs/valtio/blob/master/src/useMutableSource.ts | |
| import { useEffect, useRef, useState } from 'react'; | |
| const TARGET = Symbol('target'); | |
| const GET_VERSION = Symbol('getVersion'); | |
| export type Source<TargetType extends any, VersionType extends any> = { | |
| [TARGET]: TargetType; | |
| [GET_VERSION]: (target: TargetType) => VersionType; | |
| }; |