Julia for Decision Optimization MARTIN SHELL JUMPSTART DECISION SCIENCES Agenda qMotivation qBenchmarks qLanguage Overview qObservations qApproaches to Decision Optimization qJuMP qPython through PyCall qThe way forward Motivation qGrowth of Python Ecosystem qRich Environment for Data Science qRelatively Straightforward Language Structure qData Science Functionality from Diverse Sources qInterpreted Language qPromise of Julia qBuilt for Data Science qImproved Package Management System q“Just in Time” Compilation qStrong Typing Available Benchmarks

Source: https://julialang.org/benchmarks/ Experimental Benchmarks

Operation Python Python – numpy Julia fib(38) 17.3 sec 0.193 sec matmul (5000,7500 )x (7500, 10000) ??? 6.81 sec 6.08 sec Element-wise matrix mult 29.9 sec 1.65 sec 0.4 sec (10000,10000)^2 Julia Features Compiled not interpreted Dynamic and Static typing ◦ Strong Typing Available Can call , Python and Fortran ◦ (example later) Multiple Dispatch Native Support for Parallel Processing Package Management System Julia Typing Rich Type Hierarchy ◦ Numeric Types (Int64, Int32, Float64 …) ◦ Distinct char and string types ◦ “a” != ‘a’ ◦ ‘abcde’ throws an error ◦ Missing type (only member is – missing)

◦ Nothing type (only member is – nothing) Multiple Dispatch Example Multiple Dispatch – cont. Optmization in Julia Two Approaches ◦ “PyCall” – Allows Import of Python Functions ◦ “JuMP” – Julia Math Programming – solver-independent library ◦ Cplex ◦ ◦ GLPK ◦ CBC ◦ FICO ◦ Knitro ◦ … PyCall with Cplex Experience “Good News” ◦ Can build PyCall around Cplex ◦ Can access docplex through conda ◦ Basic Functionality Works “Bad News” ◦ Julia does not recognize Python lambdas and generators within function ◦ Not a simple translation from native Python ◦ When things go wrong, debugging is difficult – error messages not clear JuMP qBuilt on top of Julia Native Packages qMathProgBase qWraps Many Major Solvers qUses Julia Macros qRelatively Full-Featured qIntuitive API qConstraint Programming?? Observations qJulia Shows Great Potential as a Platform for Decision Optimization qPackage Ecosystem for Data Science/ML Growing Rapidly qCurrently at Version 1.2 – API’s Still Maturing qPerformance Benefits in Production Sometimes Mitigated by Overhead in Development Phase qStill Behind Python in Some Basic Functionality qEx. – DataFrames Lack Multiple Indices qJuMP Works Well – PyCall Approach can be Fragile qNeed Native Julia wrapper for Cplex, etc.