Ummm,

20mm AP (that's armor piercing) May not make really big holes in armor but your boat is not armored, so the holes will be bigger, if someone unloads a 20 round magazine into your pressure hull you won't be able to dive until you get the holes fixed, and not only may they be hard to find, you might not be able to fix them. a 1 inch hole could sink your sub, easily. Not to mention permanent damage to secondary but vital systems like batteries.
These holes, even if fixed, should also make you very nervous about your boats ability to withstand water pressure, because patches aren't as good as the original hull.
I've never been a submariner, nor am I a naval engineer, but I've watched enough Discovery Channel to have second third and fourth thoughts about diving any depth with anything compromising my pressure hull.
IMO it should maybe be even worse to get hit by flak, a near miss bomb may rattle your boat, damage delicate systems, cause plates to buckle and possibly even shake loose an engine but it won't make a hole in the pressure hull.
I suggest reading the sections on this in the GWX manual, there's more detail
edit: dammit

Mush and Goldenrivet beat me to it, and Rivet even found a movie I was going to go searching for now, oh well