If you qualified for those credits, you could have also claimed other credits for higher education tuition.
IRS probably rarely checks taxpayer's immigration status with USCIS unless they have reason to suspect something... For example, if you filed as a resident last year but file as non-resident this year, it might raise a red flag.
However, tax issues are very serious and have a lot of impact on immigration decisions if you want to obtain green card or citizenship in the future. Now, if you filed the wrong return by mistake, you can always file a 1040X to fix it, but you might have to pay some panelty and interests.
By the way, U.S. has tax treaties with China and the first 5000 dollars of your scholarship/assistantship/fellowship is non-taxable.