Hardware-agnostic AI architecture