Memory-Driven Data-Flow Optimization for Neural Processing Accelerators