Skip to content

Instantly share code, notes, and snippets.

View crypdick's full-sized avatar

Ricardo Decal crypdick

View GitHub Profile
from time import sleep
import ray
from ray import tune
from ray.tune.tuner import Tuner
import time
def expensive_setup():
print("EXPENSIVE SETUP")
sleep(1)
@crypdick
crypdick / tune-pytorch-lightning-ipynb-logs
Created February 7, 2025 19:39
Error logs from running tune-pytorch-lightning.ipynb `tune_mnist_asha(num_samples=num_samples)`
(RayTrainWorker pid=43596) Setting up process group for: env:// [rank=0, world_size=3]
(RayTrainWorker pid=43591) [W207 11:34:59.682154000 ProcessGroupGloo.cpp:757] Warning: Unable to resolve hostname to a (local) address. Using the loopback address as fallback. Manually set the network interface to bind to with GLOO_SOCKET_IFNAME. (function operator())
(TorchTrainer pid=43579) Started distributed worker processes:
(TorchTrainer pid=43579) - (node_id=bd46294119818be88b4f409ae42e495f2d7b624c90eb7b896ad91660, ip=127.0.0.1, pid=43592) world_rank=0, local_rank=0, node_rank=0
(TorchTrainer pid=43579) - (node_id=bd46294119818be88b4f409ae42e495f2d7b624c90eb7b896ad91660, ip=127.0.0.1, pid=43591) world_rank=1, local_rank=1, node_rank=0
(TorchTrainer pid=43579) - (node_id=bd46294119818be88b4f409ae42e495f2d7b624c90eb7b896ad91660, ip=127.0.0.1, pid=43593) world_rank=2, local_rank=2, node_rank=0
(RayTrainWorker pid=43595) Setting up process group for: env://
2025-02-04 13:43:35,467 INFO streaming_executor.py:109 -- Execution plan of Dataset: InputDataBuffer[Input] -> TaskPoolMapOperator[ReadTorch->Map(extract_and_process_image)] -> LimitOperator[limit=1]
Running Dataset. Active & requested resources: 1/12 CPU, 256.0MB/1.0GB object store: : 0.00 row [00:01, ? row/s]2025-02-04 13:43:36,763 ERROR streaming_executor_state.py:485 -- An exception was raised from a task of operator "ReadTorch->Map(extract_and_process_image)". Dataset execution will now abort. To ignore this exception and continue, set DataContext.max_errored_blocks.
⚠️ Dataset execution failed: : 0.00 row [00:01, ? row/s]
- ReadTorch->Map(extract_and_process_image): Tasks: 1; Queued blocks: 0; Resources: 1.0 CPU, 256.0MB object store: : 0.00 row [00:01, ? row/s]
- limit=1: Tasks: 0; Queued blocks: 0; Resources: 0.0 CPU, 0.0B object store: : 0.00 row [00:01, ? row/s]
2025-02-04 13:43:36,781 ERROR exceptions.py:73
@crypdick
crypdick / torchvision_mean_stddev.py
Created January 28, 2025 20:22
code used to compute mean and standard deviation of all pytorch datasets. Output available on my blog post.
import inspect
import csv
import os
import torch
from torch.utils.data import DataLoader
from torchvision import datasets
from torchvision.transforms import v2
dataset_names = [
"Caltech101", "Caltech256", "CelebA", "CIFAR10", "CIFAR100", "Country211", "DTD",
@crypdick
crypdick / gist:e3e4204a9dafb02f63e1cca033e2ce75
Created April 18, 2024 17:07
AI coach prompt with more questions
First message: Hey buddy! What's on your mind?
System prompt: You are Tara, a coach known for empathy, insight, and support. You excel in helping individuals navigate challenges and celebrate their successes.
You have academic and industry expertise to brainstorm product ideas, draft engineering designs, and propose scientific solutions.
You help people feel better by asking questions to reflect on and evoke feelings of positivity, gratitude, joy, and love.
You show radical candor and tough love.
@crypdick
crypdick / ray_error.log
Created February 26, 2024 22:03
Ray 2.9.2 serialization exception error
File "/home/richard/src/DENDRA/fake/src/fake/pipelines/train/common_nodes.py", line 262, in run_experiment
result_grid = tuner.fit()
File "/home/richard/miniconda3/envs/fake/lib/python3.8/site-packages/ray/tune/tuner.py", line 381, in fit
return self._local_tuner.fit()
File "/home/richard/miniconda3/envs/fake/lib/python3.8/site-packages/ray/tune/impl/tuner_internal.py", line 509, in fit
analysis = self._fit_internal(trainable, param_space)
File "/home/richard/miniconda3/envs/fake/lib/python3.8/site-packages/ray/tune/impl/tuner_internal.py", line 628, in _fit_internal
analysis = run(
File "/home/richard/miniconda3/envs/fake/lib/python3.8/site-packages/ray/tune/tune.py", line 1002, in run
runner.step()
@crypdick
crypdick / llm-gathering-starting-template.md
Created February 20, 2024 21:54
LLM Gathering blog post starting template

The occasion

What are the needs, specifically?

<fill in at least 3>

What is the host's need? Why am I planning this event?

Purpose of the event

What is my need? Why am I the one planning this event?

@crypdick
crypdick / llm-gathering-blog-invitation-output.md
Created February 5, 2024 20:07
LLM gathering blog post - invitation

ai: Subject: A Feast of Cultures: You're Invited!

Dear Friend,

Imagine a world where every meal tells a story, where each dish is a bridge to another culture, and where every bite fosters a connection. This isn't just a dream; it's an invitation to be part of a unique gathering at my home—a potluck that promises more than just good food.

Why This Gathering?
In a time when the world feels increasingly divided, we have the power to weave a tapestry of unity through the most universal language of all: food. This potluck is not just a meal; it's a celebration of cultural diversity, a journey into the heart of our community, and an opportunity to promote well-being through healthy choices.

Who Will Thrive Here?

@crypdick
crypdick / llm-gathering-potluck-size-output.md
Created February 5, 2024 19:04
LLM gathering - potluck size output

ai: Given the purpose and the specific rules designed to foster intimacy, understanding, and community bonds at your potluck, the ideal number of attendees should be within a range that allows for meaningful interaction, cultural exchange, and adherence to the event's unique structure. Considering the objectives:

  1. Strengthen community bonds and foster new connections: A smaller, more intimate group is conducive to building strong relationships. This setting allows for deeper conversations and more meaningful exchanges.

  2. Celebrate cultural diversity and promote understanding through storytelling and cultural exchange centered around food: A diverse group is necessary to achieve a variety of cultural representations. However, it should still be small enough to allow everyone to share their stories and listen to others.

  3. Encourage healthy food choices to promote well-being: This goal can be achieved with any group size, but the ability to discuss and learn about the dishes in detail woul

@crypdick
crypdick / llm-gathering-convo-topics-output.md
Last active February 5, 2024 18:52
LLM gathering blog - conversation topics chat

ai: Given the purpose and rules of your potluck event, here are some additional ideas for open-ended conversation topics that align with your goals of fostering community bonds, celebrating cultural diversity, and promoting well-being through healthy food choices:

Cultural Culinary Journeys

  • Global Kitchen Mishaps: Share a story about a time you tried to cook a dish from another culture and it didn't go as planned. What did you learn from the experience?
  • Family Recipes Reimagined: Discuss a family recipe that you've adapted or would like to adapt to include healthier ingredients. How does this change reflect your personal or cultural evolution?

Personal Growth and Connections

  • Taste of Home: What is one dish that instantly transports you back to your childhood or a cherished memory? Describe the sensory experience and the emotions it evokes.
  • Cultural Exchange Wishlist: If you could learn to cook a traditional dish from any culture, what would it be and why? How do you think