Q. Teshuvos Betzel Hachachma (3:41) writes that one shouldn’t name a shul or other holy place after a mechalel shabbos, for example, if a frum person wanted to donate a shul in memory of his parents who were mechalelei shabbos, they shouldn’t mention the parents names. If I want to donate something liluy nishmas my grandparents who were not frum, what should I do? I am thinking along the lines of, sponsoring the printing of a sefer, donating sfarim to a shul, or contributing a significant amount to building a shul. Can it be written that these things were sponsored liluy nishmas my grandfather? Would it make a difference if nobody in the shul knows who they were and that they were mechalel shabbos? 
A) On question 2565 regarding shalach manos to a non-frum individual, we wrote: It may depend on the reason why he does not keep mitzvos yet, since he may have never been educated or informed on Torah values. Thus he may be regarded as a “tinok shenishba,” and only accidentally a non-believer. (See Piskei Teshuvos 695: 11).
See also similar question 647 and 1707 regarding mourning for non-frum relatives and question 254 concerning the appending of the term a”h to the name of the deceased, if the deceased was not observant.
As mentioned in the last answer, it also depends on the traditions of the shul.
Rabbi A. Bartfeld as advised by Horav Shlomo Miller and Horav Aharon Miller Shlit’a