The effect of a linear applied shear stress gradient on the yield stress of a dislocation pileup is investigated analyti- cally using the continuum theory of dislocation pileups. The solution agrees well with numerical discrete dislocation simulations of a single source-obstacle pair. A lower order continuum viscoplastic theory and the fiinite element imple- mentation of the basic concept of stress gradient plasticity is described and the numerical model is applied to examine plasticity size effects in beam bending and micro/nano-indentation. The numerical results capture several aspects of the deformation behavior that are commonly observed in these experiments, thus laying the foundations for a full continuum theory of stress gradient plasticity.