Challenge #5 ODE solver - jtristan123/HW-for-AI-ML-ECE-410 GitHub Wiki

Challenge #5 pick 3 different Python workloads

  1. Differential equation solver
  2. Traveling salesman Problem TSP
  3. Matrix multiplication

NOTES: those are the 3 and I need some examples, Im just going to practice my vibe coding first upload the pdf file to the LLM (ChatGPT) and the 3 workloads the LLM offer 3 python scripts and told me im doing awesome already!

SIDE Question: Q: what is Python bytecode and what is the point of it? A: set of instructions that Python generates before running your code. It’s like a middle step between your source code and the machine code This makes Python portable across systems What's the Point of Bytecode?

**Understand Performance:**See how many arithmetic or memory-heavy operations your code is using. Find Bottlenecks: Some operations (like repeated calls or deep recursion) are costly β€” bytecode shows you where. Parallelism Insight: You can figure out what parts are dependent vs. independent β€” handy for mapping to CPU/GPU cores.

after running the python bytecode, it ran on the LLM I got this

  • LOAD_CONST # Load constants like 0, 5
  • IMPORT_NAME # Import scipy.integrate
  • IMPORT_FROM # Grab solve_ivp from scipy.integrate
  • STORE_FAST # Store variables like t_span, y0, solution
  • LOAD_METHOD + CALL # Call functions like np.linspace and solve_ivp
  • BUILD_TUPLE # Combine solution.t and solution.y
  • RETURN_VALUE # Return result

Now can I guess what virtual machine python is using by just looking at the bytecode............ I guess by the opcode

Instruction_Count_in_ode_solver.csv

Instruction_Comparison_Across_Workloads.csv

here is a graph rep

output (1)

5bargraph

Summary Table

sumtalbe

using cProflie and snakeviz: