The present invention relates to compounds useful as inhibitors of ATR protein kinase. The invention relates to pharmaceutically acceptable compositions comprising the compounds of this invention; methods of treating of various diseases, disorders, and conditions using the compounds of this invention; processes for preparing the compounds of this invention; intermediates for the preparation of the compounds of this invention; and solid forms of the compounds of this invention. The compounds of this invention have formula I-A or I-B: wherein the variables are as defined herein.