Skip to content

Conversation

@jlewitt1
Copy link
Collaborator

@jlewitt1 jlewitt1 commented Nov 6, 2025

No description provided.

Copy link
Collaborator Author

jlewitt1 commented Nov 6, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jlewitt1 jlewitt1 force-pushed the compute-intensive-example branch 2 times, most recently from defddbc to 3e4a3d3 Compare November 10, 2025 14:26
@jlewitt1 jlewitt1 changed the title [WIP] more compute intensive hello world example more compute intensive hello world example Nov 10, 2025
@jlewitt1 jlewitt1 force-pushed the compute-intensive-example branch 2 times, most recently from f23eb9f to 67badfa Compare November 10, 2025 14:37
README.md Outdated
Comment on lines 22 to 31
for i in range(num_iterations):
a = np.random.rand(matrix_size, matrix_size)
b = np.random.rand(matrix_size, matrix_size)

product = a @ b
iteration_sum = np.sum(product)
total_sum += iteration_sum

print(f"Iteration {i+1}: sum={iteration_sum:.3f}")
time.sleep(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

down for a slightly more involved hello world that numpy to showcase the compute/image, but I do think the content here in the for loop is not super necessary and the focus should be on the kt portion. thoughts on cutting it down more simply? e.g.

for i in range(num_iterations):
     total_sum += np.rand()
     print(f"Iteration {i+1}: sum={iteration_sum:.3f}")
 
     time.sleep(1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree the code isn't so meaningful, the only benefit is that it allows us to stream utilization metrics back.. so i'm a little torn

Copy link
Collaborator

@carolineechen carolineechen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment on potentially simplifying the numpy function. but don't feel super strongly if you think leaving it as is showcases the use case better

@jlewitt1 jlewitt1 force-pushed the compute-intensive-example branch from 67badfa to 615f6ae Compare November 12, 2025 16:34
def simulate_workload(num_iterations: int = 5, vector_size: int = 10000):
import numpy as np

return sum(np.dot(np.random.rand(vector_size), np.random.rand(vector_size)) for _ in range(num_iterations))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carolineechen better?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, can we also pass in new (kw)args to the remote_fn call below to also show that the function takes in args just as the original python function does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants